openSUSE Commits
Threads by month
- ----- 2024 -----
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
September 2017
- 1 participants
- 3820 discussions
Hello community,
here is the log from the commit of package python-pyinotify for openSUSE:Factory checked in at 2017-09-04 12:32:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pyinotify (Old)
and /work/SRC/openSUSE:Factory/.python-pyinotify.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyinotify"
Mon Sep 4 12:32:53 2017 rev:15 rq:519905 version:0.9.6
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pyinotify/python-pyinotify.changes 2016-01-05 09:41:57.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.python-pyinotify.new/python-pyinotify.changes 2017-09-04 12:32:57.223933074 +0200
@@ -1,0 +2,5 @@
+Thu Aug 24 13:50:56 UTC 2017 - jmatejek(a)suse.com
+
+- singlespec auto-conversion
+
+-------------------------------------------------------------------
@@ -61,0 +67 @@
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pyinotify.spec ++++++
--- /var/tmp/diff_new_pack.TE6klB/_old 2017-09-04 12:32:58.139804301 +0200
+++ /var/tmp/diff_new_pack.TE6klB/_new 2017-09-04 12:32:58.147803176 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pyinotify
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,6 +16,7 @@
#
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pyinotify
Version: 0.9.6
Release: 0
@@ -23,15 +24,15 @@
License: MIT
Group: Development/Libraries/Python
Url: http://github.com/seb-m/pyinotify
-Source: https://pypi.python.org/packages/source/p/pyinotify/pyinotify-%{version}.ta…
+Source: https://files.pythonhosted.org/packages/source/p/pyinotify/pyinotify-%{vers…
Source1: pyinotify
-BuildRequires: python-devel
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
+BuildRequires: %{python_module devel}
+BuildRequires: %{python_module setuptools}
+BuildRequires: python-rpm-macros
BuildArch: noarch
-%endif
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+%python_subpackages
%description
pyinotify is a Python module for watching filesystems changes. By its design
@@ -53,18 +54,30 @@
%setup -q -n pyinotify-%{version}
# remove unwanted shebang
sed -i '/^#!/ d' python2/pyinotify.py
+sed -i "s|#!/usr/bin/env python|#!%__python2|" python2/examples/*py
+sed -i "s|#!/usr/bin/env python|#!%__python3|" python3/examples/*py
%build
-python setup.py build
+%python_build
%install
-python ./setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%python_install
install -D -m 0755 %{SOURCE1} %{buildroot}%{_bindir}/pyinotify
+%python_clone -a %{buildroot}%{_bindir}/pyinotify
-%files
+%post
+%python_install_alternative pyinotify
+
+%postun
+%python_uninstall_alternative pyinotify
+
+%files %{python_files}
%defattr(-,root,root)
-%doc ACKS COPYING README.md python2/examples
-%{_bindir}/pyinotify
+%doc ACKS COPYING README.md
+%doc old/ChangeLog old/NEWS
+%python2_only %doc python2/examples
+%python3_only %doc python3/examples
+%python_alternative %{_bindir}/pyinotify
%{python_sitelib}/*
%changelog
1
0
Hello community,
here is the log from the commit of package python-piston-mini-client for openSUSE:Factory checked in at 2017-09-04 12:32:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-piston-mini-client (Old)
and /work/SRC/openSUSE:Factory/.python-piston-mini-client.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-piston-mini-client"
Mon Sep 4 12:32:44 2017 rev:10 rq:519904 version:0.7.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-piston-mini-client/python-piston-mini-client.changes 2013-10-25 11:26:44.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-piston-mini-client.new/python-piston-mini-client.changes 2017-09-04 12:32:54.880262598 +0200
@@ -1,0 +2,5 @@
+Thu Aug 24 13:49:24 UTC 2017 - jmatejek(a)suse.com
+
+- singlespec auto-conversion
+
+-------------------------------------------------------------------
@@ -43,0 +49 @@
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-piston-mini-client.spec ++++++
--- /var/tmp/diff_new_pack.KgMsHh/_old 2017-09-04 12:32:55.764138324 +0200
+++ /var/tmp/diff_new_pack.KgMsHh/_new 2017-09-04 12:32:55.776136637 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-piston-mini-client
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,24 +16,36 @@
#
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%define oldpython python
+%bcond_with test
Name: python-piston-mini-client
Version: 0.7.5
Release: 0
-Url: https://launchpad.net/piston-mini-client
Summary: A small package to consume Django-Piston web services
License: LGPL-3.0
Group: Development/Languages/Python
-Source: http://pypi.python.org/packages/source/p/piston-mini-client/piston-mini-cli…
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: python-devel
-BuildRequires: python-setuptools
-Provides: python-piston-mini = %{version}
-Obsoletes: python-piston-mini < %{version}
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
-BuildArch: noarch
+Url: https://launchpad.net/piston-mini-client
+Source: https://files.pythonhosted.org/packages/source/p/piston-mini-client/piston-…
+BuildRequires: %{python_module devel}
+BuildRequires: %{python_module setuptools}
+BuildRequires: python-rpm-macros
+%if %{with test}
+BuildRequires: %{python_module Sphinx}
+BuildRequires: %{python_module httplib2}
+BuildRequires: %{python_module mock}
+BuildRequires: %{python_module nose}
+BuildRequires: %{python_module oauthlib}
+BuildRequires: %{python_module pep8}
+BuildRequires: python3-tox
+%endif
+Requires: python-oauthlib
+%ifpython2
+Provides: %{oldpython}-piston-mini = %{version}
+Obsoletes: %{oldpython}-piston-mini < %{version}
%endif
+BuildArch: noarch
+%python_subpackages
%description
A small generic library for writing clients for Django's Piston REST APIs.
@@ -42,12 +54,17 @@
%setup -q -n piston-mini-client-%{version}
%build
-python setup.py build
+%python_build
%install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%python_install
+
+%if %{with test}
+%check
+tox --sitepackages --skip-missing-interpreters
+%endif
-%files
+%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README
%{python_sitelib}/*
1
0
Hello community,
here is the log from the commit of package python-versiontools for openSUSE:Factory checked in at 2017-09-04 12:32:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-versiontools (Old)
and /work/SRC/openSUSE:Factory/.python-versiontools.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-versiontools"
Mon Sep 4 12:32:33 2017 rev:13 rq:519903 version:1.9.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-versiontools/python-versiontools.changes 2013-10-25 11:34:28.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-versiontools.new/python-versiontools.changes 2017-09-04 12:32:53.584444793 +0200
@@ -1,0 +2,5 @@
+Thu Aug 24 13:56:58 UTC 2017 - jmatejek(a)suse.com
+
+- singlespec auto-conversion
+
+-------------------------------------------------------------------
@@ -124,0 +130 @@
+
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-versiontools.spec ++++++
--- /var/tmp/diff_new_pack.fjwD8b/_old 2017-09-04 12:32:54.368334576 +0200
+++ /var/tmp/diff_new_pack.fjwD8b/_new 2017-09-04 12:32:54.380332889 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-versiontools
#
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,23 +16,22 @@
#
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-versiontools
Version: 1.9.1
Release: 0
-Url: https://launchpad.net/versiontools
Summary: Smart replacement for plain tuple used in __version__
License: LGPL-3.0+
Group: Development/Languages/Python
-Source: http://pypi.python.org/packages/source/v/versiontools/versiontools-%{versio…
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: python-devel
-BuildRequires: python-setuptools
+Url: https://launchpad.net/versiontools
+Source: https://files.pythonhosted.org/packages/source/v/versiontools/versiontools-…
+BuildRequires: %{python_module devel}
+BuildRequires: %{python_module setuptools}
+BuildRequires: python-rpm-macros
Requires: python-setuptools
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
-%endif
+%python_subpackages
%description
Smart replacement for plain tuple used in __version__.
@@ -50,12 +49,12 @@
sed -i "1d" versiontools/{git_support,hg_support,bzr_support}.py # Fix non-executable scripts
%build
-python setup.py build
+%python_build
%install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%python_install
-%files
+%files %{python_files}
%defattr(-,root,root,-)
%doc doc/*
%{python_sitelib}/*
1
0
Hello community,
here is the log from the commit of package python-Frozen-Flask for openSUSE:Factory checked in at 2017-09-04 12:32:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Frozen-Flask (Old)
and /work/SRC/openSUSE:Factory/.python-Frozen-Flask.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Frozen-Flask"
Mon Sep 4 12:32:24 2017 rev:3 rq:519902 version:0.15
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Frozen-Flask/python-Frozen-Flask.changes 2017-02-03 18:56:58.185142697 +0100
+++ /work/SRC/openSUSE:Factory/.python-Frozen-Flask.new/python-Frozen-Flask.changes 2017-09-04 12:32:50.848829425 +0200
@@ -1,0 +2,16 @@
+Thu Aug 31 05:54:28 UTC 2017 - toddrme2178(a)gmail.com
+
+- Update to version 0.15
+ * Add Freezer.freeze_yield() method to make progress
+ reporting easier.
+- Update to version 0.14
+ * Add the FREEZER_SKIP_EXISTING configuration to skip generation
+ of files already in the build directory.
+ * Add shared superclass FrozenFlaskWarning for all warnings.
+
+-------------------------------------------------------------------
+Thu Aug 24 13:39:03 UTC 2017 - jmatejek(a)suse.com
+
+- singlespec auto-conversion
+
+-------------------------------------------------------------------
@@ -15,0 +32 @@
+
Old:
----
v0.13.tar.gz
New:
----
Frozen-Flask-0.15.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Frozen-Flask.spec ++++++
--- /var/tmp/diff_new_pack.9NnTJo/_old 2017-09-04 12:32:53.392471784 +0200
+++ /var/tmp/diff_new_pack.9NnTJo/_new 2017-09-04 12:32:53.392471784 +0200
@@ -16,36 +16,48 @@
#
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-Frozen-Flask
-Version: 0.13
+Version: 0.15
Release: 0
Summary: A Flask application into a set of static files
License: BSD-2-Clause
Group: Development/Languages/Python
-Url: http://pythonhosted.org/Frozen-Flask
-Source: https://github.com/Frozen-Flask/Frozen-Flask/archive/v%{version}.tar.gz
-BuildRequires: python-devel
-BuildRequires: python-setuptools
+Url: https://github.com/Frozen-Flask/Frozen-Flask
+Source: https://files.pythonhosted.org/packages/source/F/Frozen-Flask/Frozen-Flask-…
+BuildRequires: %{python_module Flask}
+BuildRequires: %{python_module Werkzeug}
+BuildRequires: %{python_module devel}
+BuildRequires: %{python_module setuptools}
+BuildRequires: python-rpm-macros
Requires: python-Flask
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Requires: python-Werkzeug
BuildArch: noarch
+%python_subpackages
%description
-Frozen-Flask freezes a Flask application into a set of static files. The result can be hosted without any server-side software other than a traditional web server.
+Frozen-Flask freezes a Flask application into a set of static files.
+The result can be hosted without any server-side software other than
+a traditional web server.
%prep
%setup -q -n Frozen-Flask-%{version}
%build
-python2 setup.py build
+%python_build
%install
-python2 setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%python_install
-%files
+%check
+export LANG=en_US.UTF-8
+%python_exec -m flask_frozen.tests
+
+%files %{python_files}
%defattr(-,root,root)
-%{python_sitelib}/Frozen_Flask-%{version}-py%{py_ver}.egg-info/
-%{python_sitelib}/flask_frozen/
%doc README.rst LICENSE
+%doc docs/build/html
+%{python_sitelib}/flask_frozen/
+%{python_sitelib}/Frozen_Flask-%{version}-py*.egg-info
%changelog
1
0
Hello community,
here is the log from the commit of package hawk2 for openSUSE:Factory checked in at 2017-09-04 12:32:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/hawk2 (Old)
and /work/SRC/openSUSE:Factory/.hawk2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hawk2"
Mon Sep 4 12:32:20 2017 rev:41 rq:519900 version:2.1.0+git.1504122466.88c339b3
Changes:
--------
--- /work/SRC/openSUSE:Factory/hawk2/hawk2.changes 2017-06-10 17:51:37.398555164 +0200
+++ /work/SRC/openSUSE:Factory/.hawk2.new/hawk2.changes 2017-09-04 12:32:37.974639556 +0200
@@ -1,0 +2,30 @@
+Thu Aug 31 09:30:33 UTC 2017 - kgronlund(a)suse.com
+
+- Require hawk-apiserver (fate#323437)
+
+-------------------------------------------------------------------
+Wed Aug 30 19:55:12 UTC 2017 - kgronlund(a)suse.com
+
+- Update to version 2.1.0+git.1504122466.88c339b3:
+ * Upgrade to Rails 5
+ * Drop support for bundling rubygems (fate#321115)
+ * Move hawk data files out of /srv/www (fate#321020)
+ * Remove the Strange char in Dashboard (bsc#1037430)
+ * Add have-watchdog to list of readonly options
+ * UI: Move sidebar down slightly when batch mode is enabled
+ * UI: Fix typo in template.rb
+ * Low: tools: crmd and pengine executables have moved to %_libdir/pacemaker
+ * Medium: Don't offset failure time by 10 minutes in notification (bsc#1056483)
+
+- Remove 0001-Don-t-drop-any-gems-from-bundle.patch
+- Remove json-1.8.1.gem
+- Remove rake-10.1.0.gem
+- Remove rake-10.4.2.gem
+
+-------------------------------------------------------------------
+Mon Jul 24 11:20:59 UTC 2017 - kgronlund(a)suse.com
+
+- Update to version 2.1.0+git.1500894042.99eca950:
+ * generate-ssl-cert: Make sure commonName isn't too long (bsc#1046820)
+
+-------------------------------------------------------------------
Old:
----
0001-Don-t-drop-any-gems-from-bundle.patch
hawk2-2.1.0+git.1496403895.2d3dbf1f.tar.bz2
json-1.8.1.gem
rake-10.1.0.gem
rake-10.4.2.gem
New:
----
hawk2-2.1.0+git.1504122466.88c339b3.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ hawk2.spec ++++++
--- /var/tmp/diff_new_pack.ewQHgF/_old 2017-09-04 12:32:41.546137398 +0200
+++ /var/tmp/diff_new_pack.ewQHgF/_new 2017-09-04 12:32:41.558135711 +0200
@@ -17,45 +17,43 @@
%if 0%{?suse_version}
-%define www_base /srv/www
%define vendor_ruby vendor_ruby
%define init_style suse
%define pkg_group Productivity/Clustering/HA
%else
-%define www_base /var/www
%define vendor_ruby site_ruby
%define init_style redhat
%define pkg_group System Environment/Daemons
%endif
-%define bundle_gems 1
+%define www_base %{_datadir}
+%define www_tmp %{_localstatedir}/lib/hawk/tmp
+%define www_log %{_localstatedir}/log/hawk
+
+%define rb_build_versions ruby24
+%define rb_ruby_abi ruby:2.4.0
+%define rb_ruby_suffix ruby2.4
%define gname haclient
%define uname hacluster
-%define version_unconverted 2.1.0+git.1496403895.2d3dbf1f
-
Name: hawk2
Summary: HA Web Konsole
License: GPL-2.0
Group: %{pkg_group}
-Version: 2.1.0+git.1496403895.2d3dbf1f
+Version: 2.1.0+git.1504122466.88c339b3
Release: 0
Url: http://www.clusterlabs.org/wiki/Hawk
Source: %{name}-%{version}.tar.bz2
-Source10: rake-10.4.2.gem
-Source11: json-1.8.1.gem
-Source12: rake-10.1.0.gem
Source100: hawk-rpmlintrc
-# PATCH-FIX-OPENSUSE: Don't drop any gems from bundle
-Patch1: 0001-Don-t-drop-any-gems-from-bundle.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Provides: ha-cluster-webui
Obsoletes: hawk <= 1.1.0
Provides: hawk = %{version}
-Requires: crmsh >= 2.2.0+git.1464237560
+Requires: crmsh >= 3.0.0
Requires: graphviz
Requires: graphviz-gd
+Requires: hawk-apiserver
Requires(post): %fillup_prereq
# Need a font of some kind for graphviz to work correctly (bsc#931950)
Requires: dejavu
@@ -64,7 +62,7 @@
Requires: rubypick
BuildRequires: rubypick
%endif
-Requires: rubygem(%{rb_default_ruby_abi}:bundler)
+Requires: rubygem(%{rb_ruby_abi}:bundler)
%if 0%{?suse_version}
Recommends: graphviz-gnome
Requires: iproute2
@@ -80,68 +78,45 @@
BuildRequires: pacemaker-libs-devel
%endif
-BuildRequires: rubygem(%{rb_default_ruby_abi}:builder) >= 3.2
-BuildRequires: rubygem(%{rb_default_ruby_abi}:byebug) >= 3.5
-BuildRequires: rubygem(%{rb_default_ruby_abi}:fast_gettext) >= 0.9.2
-BuildRequires: rubygem(%{rb_default_ruby_abi}:gettext:3) >= 3.1
-BuildRequires: rubygem(%{rb_default_ruby_abi}:gettext_i18n_rails:1) >= 1.2
-BuildRequires: rubygem(%{rb_default_ruby_abi}:gettext_i18n_rails_js) >= 1.0
-BuildRequires: rubygem(%{rb_default_ruby_abi}:haml-rails) >= 0.8.2
-BuildRequires: rubygem(%{rb_default_ruby_abi}:js-routes:1)
-BuildRequires: rubygem(%{rb_default_ruby_abi}:kramdown:1) >= 1.3
-BuildRequires: rubygem(%{rb_default_ruby_abi}:mail) >= 2.6
-BuildRequires: rubygem(%{rb_default_ruby_abi}:mime-types) < 3
-BuildRequires: rubygem(%{rb_default_ruby_abi}:mime-types) >= 2.5
-BuildRequires: rubygem(%{rb_default_ruby_abi}:minitest) >= 5.6
-BuildRequires: rubygem(%{rb_default_ruby_abi}:puma) >= 2.11
-BuildRequires: rubygem(%{rb_default_ruby_abi}:rails:4.2)
-BuildRequires: rubygem(%{rb_default_ruby_abi}:ruby_parser) >= 3.6.6
-BuildRequires: rubygem(%{rb_default_ruby_abi}:sass) >= 3.4
-BuildRequires: rubygem(%{rb_default_ruby_abi}:sass-rails) >= 5.0.1
-BuildRequires: rubygem(%{rb_default_ruby_abi}:sexp_processor) >= 4.5.1
-BuildRequires: rubygem(%{rb_default_ruby_abi}:spring) >= 1.3
-BuildRequires: rubygem(%{rb_default_ruby_abi}:virtus)
-
-%if 0%{?suse_version} <= 1310
-BuildRequires: rubygem(%{rb_default_ruby_abi}:rake:10.4)
-%endif
-
-BuildRequires: rubygem(%{rb_default_ruby_abi}:sprockets) >= 3.0
-BuildRequires: rubygem(%{rb_default_ruby_abi}:thor) >= 0.19
-BuildRequires: rubygem(%{rb_default_ruby_abi}:tilt:1.4)
-BuildRequires: rubygem(%{rb_default_ruby_abi}:uglifier)
-BuildRequires: rubygem(%{rb_default_ruby_abi}:web-console:2) >= 2.1
-
-%if 0%{?bundle_gems}
-%else
-# SLES bundles all this stuff at build time, other distros just
-# use runtime dependencies.
-Requires: rubygem(%{rb_default_ruby_abi}:fast_gettext) >= 0.9.2
-Requires: rubygem(%{rb_default_ruby_abi}:gettext_i18n_rails:1) >= 1.2
-Requires: rubygem(%{rb_default_ruby_abi}:gettext_i18n_rails_js) >= 1.0
-Requires: rubygem(%{rb_default_ruby_abi}:haml-rails) >= 0.8.2
-Requires: rubygem(%{rb_default_ruby_abi}:js-routes:1)
-Requires: rubygem(%{rb_default_ruby_abi}:kramdown:1) >= 1.3
-Requires: rubygem(%{rb_default_ruby_abi}:puma) >= 2.11
-Requires: rubygem(%{rb_default_ruby_abi}:rails:4.2)
-Requires: rubygem(%{rb_default_ruby_abi}:sass-rails:5.0) >= 5.0.1
-Requires: rubygem(%{rb_default_ruby_abi}:sass:3.4)
-Requires: rubygem(%{rb_default_ruby_abi}:sexp_processor) >= 4.5.1
-Requires: rubygem(%{rb_default_ruby_abi}:sprockets) >= 3.0
-Requires: rubygem(%{rb_default_ruby_abi}:tilt:1.4)
-Requires: rubygem(%{rb_default_ruby_abi}:virtus:1.0)
-
-%if 0%{?suse_version} <= 1310
-Requires: rubygem(%{rb_default_ruby_abi}:rake:10.4)
-%endif
-
-%endif
+BuildRequires: distribution-release
+BuildRequires: rubygem(%{rb_ruby_abi}:fast_gettext) >= 1.4
+BuildRequires: rubygem(%{rb_ruby_abi}:gettext) >= 3.1
+BuildRequires: rubygem(%{rb_ruby_abi}:gettext_i18n_rails) >= 1.8
+BuildRequires: rubygem(%{rb_ruby_abi}:gettext_i18n_rails_js) >= 1.3
+BuildRequires: rubygem(%{rb_ruby_abi}:js-routes) >= 1.3.3
+BuildRequires: rubygem(%{rb_ruby_abi}:kramdown) >= 1.14
+BuildRequires: rubygem(%{rb_ruby_abi}:mail:2.5)
+BuildRequires: rubygem(%{rb_ruby_abi}:puma) >= 3
+BuildRequires: rubygem(%{rb_ruby_abi}:rails:5)
+BuildRequires: rubygem(%{rb_ruby_abi}:sass) >= 3.4
+BuildRequires: rubygem(%{rb_ruby_abi}:sass-rails) >= 5.0.1
+BuildRequires: rubygem(%{rb_ruby_abi}:spring) >= 1.3
+BuildRequires: rubygem(%{rb_ruby_abi}:virtus) >= 1.0.1
+
+BuildRequires: rubygem(%{rb_ruby_abi}:sprockets) >= 3.7
+BuildRequires: rubygem(%{rb_ruby_abi}:tilt) >= 2.0
+BuildRequires: rubygem(%{rb_ruby_abi}:uglifier) >= 3.0
+BuildRequires: rubygem(%{rb_ruby_abi}:web-console) >= 2.2
+
+Requires: rubygem(%{rb_ruby_abi}:fast_gettext) >= 1.4
+Requires: rubygem(%{rb_ruby_abi}:gettext_i18n_rails) >= 1.8
+Requires: rubygem(%{rb_ruby_abi}:gettext_i18n_rails_js) >= 1.3
+Requires: rubygem(%{rb_ruby_abi}:js-routes) >= 1.3.3
+Requires: rubygem(%{rb_ruby_abi}:kramdown) >= 1.14
+Requires: rubygem(%{rb_ruby_abi}:puma) >= 3
+Requires: rubygem(%{rb_ruby_abi}:rails:5)
+Requires: rubygem(%{rb_ruby_abi}:sass) >= 3.4
+Requires: rubygem(%{rb_ruby_abi}:sass-rails) >= 5.0.1
+Requires: rubygem(%{rb_ruby_abi}:sprockets) >= 3.0
+Requires: rubygem(%{rb_ruby_abi}:tilt) >= 2.0
+Requires: rubygem(%{rb_ruby_abi}:virtus) >= 1.0
-BuildRequires: %{rubydevel >= 1.8.7}
+BuildRequires: %{rubydevel >= 2.4}
BuildRequires: git
BuildRequires: glib2-devel
BuildRequires: libxml2-devel >= 2.6.21
BuildRequires: libxslt-devel
+BuildRequires: nodejs6
BuildRequires: openssl-devel
BuildRequires: pam-devel
@@ -152,31 +127,21 @@
%prep
%setup
-%patch1 -p1
%build
+sed -i 's$#!/.*$#!%{_bindir}/ruby.%{rb_ruby_suffix}$' hawk/bin/rails
+sed -i 's$#!/.*$#!%{_bindir}/ruby.%{rb_ruby_suffix}$' hawk/bin/rake
+sed -i 's$#!/.*$#!%{_bindir}/ruby.%{rb_ruby_suffix}$' hawk/bin/bundle
export NOKOGIRI_USE_SYSTEM_LIBRARIES=1
CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
export CFLAGS
-mkdir -p hawk/vendor/cache
-install -D -m0644 %{S:10} %{S:11} %{S:12} hawk/vendor/cache
-make WWW_BASE=%{www_base} INIT_STYLE=%{init_style} LIBDIR=%{_libdir} BINDIR=%{_bindir} SBINDIR=%{_sbindir} BUNDLE_GEMS=%{expand:%{?bundle_gems:true}%{!?bundle_gems:false}} RUBY_ABI=%{rb_ver}
+make WWW_BASE=%{www_base} WWW_TMP=%{www_tmp} WWW_LOG=%{www_log} INIT_STYLE=%{init_style} LIBDIR=%{_libdir} BINDIR=%{_bindir} SBINDIR=%{_sbindir} RUBY_SUFFIX=.%{rb_ruby_suffix}
%install
-make WWW_BASE=%{www_base} INIT_STYLE=%{init_style} DESTDIR=%{buildroot} BUNDLE_GEMS=%{expand:%{?bundle_gems:true}%{!?bundle_gems:false}} install
-sed -i 's$#!/.*$#!/usr/bin/ruby.%{rb_default_ruby_suffix}$' %{buildroot}%{www_base}/hawk/bin/bundle
+make WWW_BASE=%{www_base} WWW_TMP=%{www_tmp} WWW_LOG=%{www_log} INIT_STYLE=%{init_style} DESTDIR=%{buildroot} install
# copy of GPL
cp COPYING %{buildroot}%{www_base}/hawk/
-%if 0%{?bundle_gems}
-# get rid of gem sample and test cruft
-rm -rf %{buildroot}%{www_base}/hawk/vendor/bundle/ruby/*/gems/*/doc
-rm -rf %{buildroot}%{www_base}/hawk/vendor/bundle/ruby/*/gems/*/examples
-rm -rf %{buildroot}%{www_base}/hawk/vendor/bundle/ruby/*/gems/*/samples
-rm -rf %{buildroot}%{www_base}/hawk/vendor/bundle/ruby/*/gems/*/test
-rm -rf %{buildroot}%{www_base}/hawk/vendor/bundle/ruby/*/gems/*/ports
-rm -rf %{buildroot}%{www_base}/hawk/vendor/bundle/ruby/*/gems/*/ext
-%endif
%if 0%{?suse_version}
# Hack so missing links to docs don't kill the build
@@ -201,7 +166,7 @@
touch hawk.lang
%endif
# more cruft to clean up (WTF?)
-rm -f %{buildroot}%{www_base}/hawk/log/*
+rm -f %{buildroot}%{www_log}/*
# likewise .git special files
find %{buildroot}%{www_base}/hawk -type f -name '.git*' -print0 | xargs --no-run-if-empty -0 rm
%if 0%{?suse_version}
@@ -246,9 +211,11 @@
%attr(4750, root, %{gname})%{_sbindir}/hawk_invoke
%attr(0755, root, root) %{_sbindir}/hawk_monitor
%dir %{www_base}/hawk
+%{www_base}/hawk/log
+%{www_base}/hawk/tmp
%{www_base}/hawk/app
%{www_base}/hawk/config
-%{www_base}/hawk/lib
+%dir %{_localstatedir}/lib/hawk
%dir %{www_base}/hawk/bin
%attr(0755, root, root)%{www_base}/hawk/bin/rake
%attr(0755, root, root)%{www_base}/hawk/bin/rails
@@ -256,28 +223,19 @@
%attr(0755, root, root)%{www_base}/hawk/bin/generate-ssl-cert
%attr(0755, root, root)%{www_base}/hawk/bin/bundle
%attr(0750, %{uname},%{gname})%{_sysconfdir}/hawk
-%attr(0750, %{uname},%{gname})%{www_base}/hawk/log
-%dir %attr(0750, %{uname},%{gname})%{www_base}/hawk/tmp
-%attr(-, %{uname},%{gname})%{www_base}/hawk/tmp/cache
-%attr(-, %{uname},%{gname})%{www_base}/hawk/tmp/explorer
-%attr(-, %{uname},%{gname})%{www_base}/hawk/tmp/home
-%attr(-, %{uname},%{gname})%{www_base}/hawk/tmp/pids
-%attr(-, %{uname},%{gname})%{www_base}/hawk/tmp/sessions
-%attr(-, %{uname},%{gname})%{www_base}/hawk/tmp/sockets
-%exclude %{www_base}/hawk/tmp/session_secret
+%dir %attr(0750, %{uname},%{gname})%{www_log}
+%dir %attr(0750, %{uname},%{gname})%{www_tmp}
+%attr(-, %{uname},%{gname})%{www_tmp}/cache
+%attr(-, %{uname},%{gname})%{www_tmp}/explorer
+%attr(-, %{uname},%{gname})%{www_tmp}/home
+%attr(-, %{uname},%{gname})%{www_tmp}/pids
+%attr(-, %{uname},%{gname})%{www_tmp}/sessions
+%attr(-, %{uname},%{gname})%{www_tmp}/sockets
%{www_base}/hawk/locale/hawk.pot
-%if 0%{?bundle_gems}
-%{www_base}/hawk/.bundle
-%endif
%{www_base}/hawk/public
%{www_base}/hawk/Rakefile
-%if 0%{?bundle_gems}
-%{www_base}/hawk/Gemfile
-%{www_base}/hawk/Gemfile.lock
-%else
%exclude %{www_base}/hawk/Gemfile
%exclude %{www_base}/hawk/Gemfile.lock
-%endif
%{www_base}/hawk/COPYING
%{www_base}/hawk/config.ru
%{www_base}/hawk/test
@@ -297,11 +255,6 @@
# warnings for bundled gems.
%{www_base}/hawk/vendor
-%if 0%{?bundle_gems}
-%attr(0755, root, root) %{www_base}/hawk/vendor/bundle/ruby/*/bin/puma
-%attr(0755, root, root) %{www_base}/hawk/vendor/bundle/ruby/*/bin/pumactl
-%endif
-
%{_unitdir}/hawk.service
%if 0%{?suse_version}
%attr(-,root,root) %{_sbindir}/rchawk
++++++ _service ++++++
--- /var/tmp/diff_new_pack.ewQHgF/_old 2017-09-04 12:32:41.674119404 +0200
+++ /var/tmp/diff_new_pack.ewQHgF/_new 2017-09-04 12:32:41.674119404 +0200
@@ -5,7 +5,7 @@
<param name="exclude">.git</param>
<param name="filename">hawk2</param>
<param name="versionformat">2.1.0+git.%ct.%h</param>
- <param name="revision">sle-12-sp3</param>
+ <param name="revision">master</param>
<param name="changesgenerate">enable</param>
</service>
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.ewQHgF/_old 2017-09-04 12:32:41.746109282 +0200
+++ /var/tmp/diff_new_pack.ewQHgF/_new 2017-09-04 12:32:41.750108720 +0200
@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/ClusterLabs/hawk.git</param>
- <param name="changesrevision">2d3dbf1f7098d87725d904503e77f6c82664e31c</param></service></servicedata>
\ No newline at end of file
+ <param name="changesrevision">88c339b371e8f3bcf5c730fea60a8f6c5dca9307</param></service></servicedata>
\ No newline at end of file
++++++ hawk2-2.1.0+git.1496403895.2d3dbf1f.tar.bz2 -> hawk2-2.1.0+git.1504122466.88c339b3.tar.bz2 ++++++
/work/SRC/openSUSE:Factory/hawk2/hawk2-2.1.0+git.1496403895.2d3dbf1f.tar.bz2 /work/SRC/openSUSE:Factory/.hawk2.new/hawk2-2.1.0+git.1504122466.88c339b3.tar.bz2 differ: char 11, line 1
1
0
Hello community,
here is the log from the commit of package ha-cluster-bootstrap for openSUSE:Factory checked in at 2017-09-04 12:32:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ha-cluster-bootstrap (Old)
and /work/SRC/openSUSE:Factory/.ha-cluster-bootstrap.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ha-cluster-bootstrap"
Mon Sep 4 12:32:02 2017 rev:33 rq:519890 version:0.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/ha-cluster-bootstrap/ha-cluster-bootstrap.changes 2017-02-20 13:14:10.428229171 +0100
+++ /work/SRC/openSUSE:Factory/.ha-cluster-bootstrap.new/ha-cluster-bootstrap.changes 2017-09-04 12:32:02.767589704 +0200
@@ -1,0 +2,5 @@
+Tue Jul 25 13:31:00 UTC 2017 - kgronlund(a)suse.com
+
+- Recommend sbd, resource-agents and fence-agents (bsc#1050427)
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ha-cluster-bootstrap.spec ++++++
--- /var/tmp/diff_new_pack.haKeba/_old 2017-09-04 12:32:03.651465431 +0200
+++ /var/tmp/diff_new_pack.haKeba/_new 2017-09-04 12:32:03.655464868 +0200
@@ -28,6 +28,7 @@
BuildRequires: crmsh >= 3
BuildRequires: help2man
+BuildRequires: python2-parallax
Requires: crmsh >= 3
Requires: ha-cluster-webui
Requires: iproute2
@@ -35,6 +36,9 @@
Requires: util-linux
Recommends: hawk2
Recommends: ocfs2-tools
+Recommends: sbd
+Recommends: resource-agents
+Recommends: fence-agents
# These three are required for ocfs2 setup, but not generic setup
Recommends: parted
BuildRoot: %{_tmppath}/%{name}-%{version}-build
1
0
Hello community,
here is the log from the commit of package rubygem-mocha for openSUSE:Factory checked in at 2017-09-04 12:31:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-mocha (Old)
and /work/SRC/openSUSE:Factory/.rubygem-mocha.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-mocha"
Mon Sep 4 12:31:56 2017 rev:24 rq:519889 version:1.3.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-mocha/rubygem-mocha.changes 2016-11-07 12:23:03.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.rubygem-mocha.new/rubygem-mocha.changes 2017-09-04 12:32:01.239804512 +0200
@@ -1,0 +2,25 @@
+Fri Aug 25 08:08:48 UTC 2017 - mschnitzer(a)suse.com
+
+- updated to version 1.3.0
+ * Ensure all tests run individually - thanks to @chrisroos (#267)
+ * Update Travis CI build status badge to show master branch status (#264)
+ * Correct RSpec section of the README - thanks to @myronmarston (0cc039c8)
+ * Fix pretty printing of quotes in String#mocha_inspect (#215 & #223)
+ * Add release instructions to README - thanks to @chrisroos (70a5febd & 3c664df7)
+ * Require at least Ruby v1.8.7 in gemspec - thanks to @knappe (3e20be8e)
+ * Remove redundant InstanceMethod#method_exists? - thanks to @chrisroos (8f58eddf)
+ * Reduce risk of hitting bug 12832 in Ruby v2.3 - thanks to @chrisroos (#277 & eca7560c)
+ * Fix JRuby build - thanks to @headius (jruby/jruby#4250) & @chrisroos (#274)
+ * Add latest stable version of JRuby to Travis CI build matrix (#288)
+ * Fix Ruby v1.8.7 builds on Travis CI (928b5a40 & 460dce5b)
+ * Deprecate passing block to mock object constructor (#290)
+ * Add a known issue to README for Ruby bug 12876 (#276)
+ * Add Ruby 2.4 and ruby-head to Travis CI build matrix - thanks to @junaruga (#297)
+ * Fix Mocha::ParameterMatchers#includes for Array values - thanks to @timcraft (#302)
+ * Use faster container-based virtual environments for Travis CI builds (#305)
+ * Rename Mocha::ParameterMatchers::QueryStringMatches to QueryString (#306)
+ * Handle blank parameter value for query string matcher - thanks to @weynsee (#303 & #304)
+ * Rename Mocha::ParameterMatchers::QueryString -> EquivalentUri (#307)
+ * Use do ... end instead of { ... } in acceptance tests - thanks to @chrisroos (#294)
+
+-------------------------------------------------------------------
Old:
----
mocha-1.2.1.gem
New:
----
mocha-1.3.0.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-mocha.spec ++++++
--- /var/tmp/diff_new_pack.KwZU3W/_old 2017-09-04 12:32:01.947704981 +0200
+++ /var/tmp/diff_new_pack.KwZU3W/_new 2017-09-04 12:32:01.947704981 +0200
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-mocha
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,16 +24,16 @@
#
Name: rubygem-mocha
-Version: 1.2.1
+Version: 1.3.0
Release: 0
%define mod_name mocha
%define mod_full_name %{mod_name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: %{rubygem gem2rpm}
-BuildRequires: %{ruby}
BuildRequires: ruby-macros >= 5
+BuildRequires: %{ruby >= 1.8.7}
+BuildRequires: %{rubygem gem2rpm}
Url: http://gofreerange.com/mocha/docs
-Source: http://rubygems.org/gems/%{mod_full_name}.gem
+Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: Mocking and stubbing library
License: MIT and BSD-2-Clause
++++++ mocha-1.2.1.gem -> mocha-1.3.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2016-10-15 15:09:06.000000000 +0200
+++ new/README.md 2017-08-24 23:44:56.000000000 +0200
@@ -1,4 +1,4 @@
-## Mocha [![build status](https://secure.travis-ci.org/freerange/mocha.png)](https://secure.t… [![Gem Version](https://badge.fury.io/rb/mocha.png)](http://badge.fury.io/rb/mocha) [![OpenCollective](https://opencollective.com/mocha/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/mocha/sponsors/badge.svg)](#sponsors)
+## Mocha [![Build Status](https://travis-ci.org/freerange/mocha.svg?branch=master)](https://t… [![Gem Version](https://badge.fury.io/rb/mocha.png)](http://badge.fury.io/rb/mocha) [![OpenCollective](https://opencollective.com/mocha/backers/badge.svg)](#backers) [![OpenCollective](https://opencollective.com/mocha/sponsors/badge.svg)](#sponsors)
### Description
@@ -78,7 +78,7 @@
##### RSpec
-Assuming you are using the `rspec-rails` gem:
+RSpec includes a mocha adapter. Just tell RSpec you want to mock with `:mocha`:
```ruby
# Gemfile in Rails app
@@ -110,6 +110,7 @@
#### Known Issues
* In Mocha v1.2.0 there is a scenario where stubbing a class method originally defined in a module hangs the Ruby interpreter due to [a bug in Ruby v2.3.1](https://bugs.ruby-lang.org/issues/12832). See #272. This was fixed in Mocha v1.2.1.
+* Since v1.1.0 Mocha has used prepended modules internally for stubbing methods. There is [an obscure Ruby bug](https://bugs.ruby-lang.org/issues/12876) in many (but not all) versions of Ruby between v2.0 & v2.3 which under certain circumstances may cause your Ruby interpreter to hang. See the Ruby bug report for more details. The bug has been fixed in Ruby v2.3.3 & v2.4.0.
* Stubbing an aliased class method, where the original method is defined in a module that's used to `extend` the class doesn't work in Ruby 1.8.x. See stub_method_defined_on_module_and_aliased_test.rb for an example of this behaviour.
* 0.13.x versions cause a harmless, but annoying, deprecation warning when used with Rails 3.2.0-3.2.12, 3.1.0-3.1.10 & 3.0.0-3.0.19.
* 0.11.x versions don't work with Rails 3.2.13 (`TypeError: superclass mismatch for class ExpectationError`). See #115.
@@ -281,7 +282,7 @@
See this [list of contributors](https://github.com/freerange/mocha/graphs/contributors).
-###Backers
+### Backers
Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/mocha#backer)]
@@ -317,6 +318,7 @@
<a href="https://opencollective.com/mocha/backer/29/website" target="_blank"><img src="https://opencollective.com/mocha/backer/29/avatar.svg"></a>
### Sponsors
+
Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/mocha#sponsor)]
<a href="https://opencollective.com/mocha/sponsor/0/website" target="_blank"><img src="https://opencollective.com/mocha/sponsor/0/avatar.svg"></a>
@@ -354,6 +356,35 @@
* [Serbo-Croatian](http://science.webhostinggeeks.com/mocha) by [WHG Team](http://webhostinggeeks.com/). (may be out-of-date)
+### Releasing a new version
+
+* Update the RELEASE.md file with a summary of changes
+* Bump the version in `lib/mocha/version.rb`
+* Commit & push to Github
+* Check Travis CI build is passing - https://travis-ci.org/freerange/mocha
+
+* Sign in to rubygems.org and find API key - https://rubygems.org/profile/edit
+
+```bash
+$ curl -u james(a)floehopper.org https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials`
+```
+
+* Sign in to Google Analytics - https://analytics.google.com/analytics/web/
+* Find the web property ID for Go Free Range Ltd > Mocha Documentation (UA-45002715-2)
+
+```bash
+$ MOCHA_GENERATE_DOCS=true bundle install
+
+$ MOCHA_GENERATE_DOCS=true GOOGLE_ANALYTICS_WEB_PROPERTY_ID=UA-45002715-2 rake release
+mocha 1.2.0 built to pkg/mocha-1.2.0.gem.
+Tagged v1.2.0.
+Pushed git commits and tags.
+Pushed mocha 1.2.0 to rubygems.org.
+[runs tests]
+[generates docs]
+[deploys docs]
+```
+
### History
Mocha was initially harvested from projects at [Reevoo](http://www.reevoo.com/). It's syntax is heavily based on that of [jMock](http://www.jmock.org).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/RELEASE.md new/RELEASE.md
--- old/RELEASE.md 2016-10-15 15:09:06.000000000 +0200
+++ new/RELEASE.md 2017-08-24 23:44:56.000000000 +0200
@@ -1,5 +1,28 @@
# Release Notes
+## 1.3.0
+
+* Ensure all tests run individually - thanks to @chrisroos (#267)
+* Update Travis CI build status badge to show master branch status (#264)
+* Correct RSpec section of the README - thanks to @myronmarston (0cc039c8)
+* Fix pretty printing of quotes in `String#mocha_inspect` (#215 & #223)
+* Add release instructions to README - thanks to @chrisroos (70a5febd & 3c664df7)
+* Require at least Ruby v1.8.7 in gemspec - thanks to @knappe (3e20be8e)
+* Remove redundant InstanceMethod#method_exists? - thanks to @chrisroos (8f58eddf)
+* Reduce risk of hitting bug 12832 in Ruby v2.3 - thanks to @chrisroos (#277 & eca7560c)
+* Fix JRuby build - thanks to @headius (jruby/jruby#4250) & @chrisroos (#274)
+* Add latest stable version of JRuby to Travis CI build matrix (#288)
+* Fix Ruby v1.8.7 builds on Travis CI (928b5a40 & 460dce5b)
+* Deprecate passing block to mock object constructor (#290)
+* Add a known issue to README for Ruby bug 12876 (#276)
+* Add Ruby 2.4 and ruby-head to Travis CI build matrix - thanks to @junaruga (#297)
+* Fix `Mocha::ParameterMatchers#includes` for `Array` values - thanks to @timcraft (#302)
+* Use faster container-based virtual environments for Travis CI builds (#305)
+* Rename `Mocha::ParameterMatchers::QueryStringMatches` to `QueryString` (#306)
+* Handle blank parameter value for query string matcher - thanks to @weynsee (#303 & #304)
+* Rename `Mocha::ParameterMatchers::QueryString` -> `EquivalentUri` (#307)
+* Use `do ... end` instead of `{ ... }` in acceptance tests - thanks to @chrisroos (#294)
+
## 1.2.1
* Fixed #272. Workaround Ruby bug 12832 which caused interpreter to hang. See https://bugs.ruby-lang.org/issues/12832. Thanks to @chrisroos & @petems (6f1c8b9b, #273).
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/any_instance_method.rb new/lib/mocha/any_instance_method.rb
--- old/lib/mocha/any_instance_method.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/any_instance_method.rb 2017-08-24 23:44:56.000000000 +0200
@@ -16,11 +16,11 @@
def hide_original_method
if @original_visibility = method_visibility(method)
begin
- @original_method = stubbee.instance_method(method)
if RUBY_V2_PLUS
@definition_target = PrependedModule.new
stubbee.__send__ :prepend, @definition_target
else
+ @original_method = stubbee.instance_method(method)
if @original_method && @original_method.owner == stubbee
stubbee.send(:remove_method, method)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/api.rb new/lib/mocha/api.rb
--- old/lib/mocha/api.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/api.rb 2017-08-24 23:44:56.000000000 +0200
@@ -25,7 +25,9 @@
#
# @param [String] name identifies mock object in error messages.
# @param [Hash] expected_methods_vs_return_values expected method name symbols as keys and corresponding return values as values - these expectations are setup as if {Mock#expects} were called multiple times.
- # @yield optional block to be evaluated against the mock object instance, giving an alternative way to setup expectations.
+ # @yield optional block to be evaluated in the context of the mock object instance, giving an alternative way to setup stubbed methods.
+ # @yield note that the block is evaulated by calling Mock#instance_eval and so things like instance variables declared in the test will not be available within the block.
+ # @yield deprecated: use Object#tap or define stubs/expectations with an explicit receiver instead.
# @return [Mock] a new mock object
#
# @overload def mock(name, &block)
@@ -39,7 +41,7 @@
# assert motor.stop
# # an error will be raised unless both Motor#start and Motor#stop have been called
# end
- # @example Using the optional block to setup expectations & stubbed methods.
+ # @example Using the optional block to setup expectations & stubbed methods [deprecated].
# def test_motor_starts_and_stops
# motor = mock('motor') do
# expects(:start).with(100.rpm).returns(true)
@@ -61,7 +63,9 @@
#
# @param [String] name identifies mock object in error messages.
# @param [Hash] stubbed_methods_vs_return_values stubbed method name symbols as keys and corresponding return values as values - these stubbed methods are setup as if {Mock#stubs} were called multiple times.
- # @yield optional block to be evaluated against the mock object instance, giving an alternative way to setup stubbed methods.
+ # @yield optional block to be evaluated in the context of the mock object instance, giving an alternative way to setup stubbed methods.
+ # @yield note that the block is evaulated by calling Mock#instance_eval and so things like instance variables declared in the test will not be available within the block.
+ # @yield deprecated: use Object#tap or define stubs/expectations with an explicit receiver instead.
# @return [Mock] a new mock object
#
# @overload def stub(name, &block)
@@ -76,7 +80,7 @@
# # an error will not be raised even if either Motor#start or Motor#stop has not been called
# end
#
- # @example Using the optional block to setup expectations & stubbed methods.
+ # @example Using the optional block to setup expectations & stubbed methods [deprecated].
# def test_motor_starts_and_stops
# motor = stub('motor') do
# expects(:start).with(100.rpm).returns(true)
@@ -98,7 +102,9 @@
#
# @param [String] name identifies mock object in error messages.
# @param [Hash] stubbed_methods_vs_return_values stubbed method name symbols as keys and corresponding return values as values - these stubbed methods are setup as if {Mock#stubs} were called multiple times.
- # @yield optional block to be evaluated against the mock object instance, giving an alternative way to setup stubbed methods.
+ # @yield optional block to be evaluated in the context of the mock object instance, giving an alternative way to setup stubbed methods.
+ # @yield note that the block is evaulated by calling Mock#instance_eval and so things like instance variables declared in the test will not be available within the block.
+ # @yield deprecated: use Object#tap or define stubs/expectations with an explicit receiver instead.
# @return [Mock] a new mock object
#
# @overload def stub_everything(name, &block)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/inspect.rb new/lib/mocha/inspect.rb
--- old/lib/mocha/inspect.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/inspect.rb 2017-08-24 23:44:56.000000000 +0200
@@ -10,12 +10,6 @@
end
end
- module StringMethods
- def mocha_inspect
- inspect.gsub(/\"/, "'")
- end
- end
-
module ArrayMethods
def mocha_inspect
"[#{collect { |member| member.mocha_inspect }.join(', ')}]"
@@ -46,10 +40,6 @@
include Mocha::ObjectMethods
end
-class String
- include Mocha::StringMethods
-end
-
class Array
include Mocha::ArrayMethods
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/instance_method.rb new/lib/mocha/instance_method.rb
--- old/lib/mocha/instance_method.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/instance_method.rb 2017-08-24 23:44:56.000000000 +0200
@@ -3,14 +3,6 @@
module Mocha
class InstanceMethod < ClassMethod
-
- def method_exists?(method)
- return true if stubbee.public_methods(false).include?(method)
- return true if stubbee.protected_methods(false).include?(method)
- return true if stubbee.private_methods(false).include?(method)
- return false
- end
-
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/mock.rb new/lib/mocha/mock.rb
--- old/lib/mocha/mock.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/mock.rb 2017-08-24 23:44:56.000000000 +0200
@@ -8,6 +8,7 @@
require 'mocha/unexpected_invocation'
require 'mocha/argument_iterator'
require 'mocha/expectation_error_factory'
+require 'mocha/deprecation'
module Mocha
@@ -259,7 +260,10 @@
@everything_stubbed = false
@responder = nil
@unexpected_invocation = nil
- instance_eval(&block) if block
+ if block
+ Deprecation.warning('Passing a block is deprecated. Use Object#tap or define stubs/expectations with an explicit receiver instead.')
+ instance_eval(&block)
+ end
end
# @private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/parameter_matchers/equivalent_uri.rb new/lib/mocha/parameter_matchers/equivalent_uri.rb
--- old/lib/mocha/parameter_matchers/equivalent_uri.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/lib/mocha/parameter_matchers/equivalent_uri.rb 2017-08-24 23:44:56.000000000 +0200
@@ -0,0 +1,67 @@
+require 'mocha/deprecation'
+require 'mocha/parameter_matchers/base'
+require 'uri'
+require 'cgi'
+
+module Mocha
+ module ParameterMatchers
+
+ # Matches a URI without regard to the ordering of parameters in the query string.
+ #
+ # @param [String] uri URI to match.
+ # @return [EquivalentUri] parameter matcher.
+ #
+ # @see Expectation#with
+ #
+ # @example Actual URI is equivalent.
+ # object = mock()
+ # object.expects(:method_1).with(equivalent_uri('http://example.com/foo?a=1&b=2))
+ # object.method_1('http://example.com/foo?b=2&a=1')
+ # # no error raised
+ #
+ # @example Actual URI is not equivalent.
+ # object = mock()
+ # object.expects(:method_1).with(equivalent_uri('http://example.com/foo?a=1&b=2))
+ # object.method_1('http://example.com/foo?a=1&b=3')
+ # # error raised, because the query parameters were different
+ def equivalent_uri(uri)
+ EquivalentUri.new(uri)
+ end
+
+ # @deprecated Use {#equivalent_uri} instead.
+ def has_equivalent_query_string(uri)
+ Mocha::Deprecation.warning("`has_equivalent_query_string` is deprecated. Please use `equivalent_uri` instead.")
+
+ equivalent_uri(uri)
+ end
+
+ # Parameter matcher which matches URIs with equivalent query strings.
+ class EquivalentUri < Base
+
+ # @private
+ def initialize(uri)
+ @uri = URI.parse(uri)
+ end
+
+ # @private
+ def matches?(available_parameters)
+ actual = explode(URI.parse(available_parameters.shift))
+ expected = explode(@uri)
+ actual == expected
+ end
+
+ # @private
+ def mocha_inspect
+ "equivalent_uri(#{(a)uri.mocha_inspect})"
+ end
+
+ private
+ # @private
+ def explode(uri)
+ query_hash = CGI.parse(uri.query || '')
+ URI::Generic::COMPONENT.inject({}){ |h, k| h.merge(k => uri.__send__(k)) }.merge(:query => query_hash)
+ end
+
+ end
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/parameter_matchers/includes.rb new/lib/mocha/parameter_matchers/includes.rb
--- old/lib/mocha/parameter_matchers/includes.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/parameter_matchers/includes.rb 2017-08-24 23:44:56.000000000 +0200
@@ -80,7 +80,8 @@
return false unless parameter.respond_to?(:include?)
if @items.size == 1
if parameter.respond_to?(:any?) && !parameter.is_a?(String)
- return parameter.any? { |(p,_)| @items.first.to_matcher.matches?([p]) }
+ parameter = parameter.keys if parameter.is_a?(Hash)
+ return parameter.any? { |p| @items.first.to_matcher.matches?([p]) }
else
return parameter.include?((a)items.first)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/parameter_matchers/query_string.rb new/lib/mocha/parameter_matchers/query_string.rb
--- old/lib/mocha/parameter_matchers/query_string.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/parameter_matchers/query_string.rb 1970-01-01 01:00:00.000000000 +0100
@@ -1,58 +0,0 @@
-require 'mocha/parameter_matchers/base'
-require 'uri'
-
-module Mocha
- module ParameterMatchers
-
- # Matches a URI without regard to the ordering of parameters in the query string.
- #
- # @param [String] uri URI to match.
- # @return [QueryStringMatches] parameter matcher.
- #
- # @see Expectation#with
- #
- # @example Actual URI has equivalent query string.
- # object = mock()
- # object.expects(:method_1).with(has_equivalent_query_string('http://example.com/foo?a=1&b=2))
- # object.method_1('http://example.com/foo?b=2&a=1')
- # # no error raised
- #
- # @example Actual URI does not have equivalent query string.
- # object = mock()
- # object.expects(:method_1).with(has_equivalent_query_string('http://example.com/foo?a=1&b=2))
- # object.method_1('http://example.com/foo?a=1&b=3')
- # # error raised, because the query parameters were different
- def has_equivalent_query_string(uri)
- QueryStringMatches.new(uri)
- end
-
- # Parameter matcher which matches URIs with equivalent query strings.
- class QueryStringMatches < Base
-
- # @private
- def initialize(uri)
- @uri = URI.parse(uri)
- end
-
- # @private
- def matches?(available_parameters)
- actual = explode(URI.parse(available_parameters.shift))
- expected = explode(@uri)
- actual == expected
- end
-
- # @private
- def mocha_inspect
- "has_equivalent_query_string(#{(a)uri.mocha_inspect})"
- end
-
- private
- # @private
- def explode(uri)
- query_hash = (uri.query || '').split('&').inject({}){ |h, kv| h.merge(Hash[*kv.split('=')]) }
- URI::Generic::COMPONENT.inject({}){ |h, k| h.merge(k => uri.__send__(k)) }.merge(:query => query_hash)
- end
-
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/parameter_matchers.rb new/lib/mocha/parameter_matchers.rb
--- old/lib/mocha/parameter_matchers.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/parameter_matchers.rb 2017-08-24 23:44:56.000000000 +0200
@@ -25,4 +25,4 @@
require 'mocha/parameter_matchers/regexp_matches'
require 'mocha/parameter_matchers/responds_with'
require 'mocha/parameter_matchers/yaml_equivalent'
-require 'mocha/parameter_matchers/query_string'
+require 'mocha/parameter_matchers/equivalent_uri'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/mocha/version.rb new/lib/mocha/version.rb
--- old/lib/mocha/version.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/lib/mocha/version.rb 2017-08-24 23:44:56.000000000 +0200
@@ -1,3 +1,3 @@
module Mocha
- VERSION = "1.2.1"
+ VERSION = "1.3.0"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2016-10-15 15:09:06.000000000 +0200
+++ new/metadata 2017-08-24 23:44:56.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: mocha
version: !ruby/object:Gem::Version
- version: 1.2.1
+ version: 1.3.0
platform: ruby
authors:
- James Mead
autorequire:
bindir: bin
cert_chain: []
-date: 2016-10-15 00:00:00.000000000 Z
+date: 2017-08-24 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: metaclass
@@ -194,6 +194,7 @@
- lib/mocha/parameter_matchers/anything.rb
- lib/mocha/parameter_matchers/base.rb
- lib/mocha/parameter_matchers/equals.rb
+- lib/mocha/parameter_matchers/equivalent_uri.rb
- lib/mocha/parameter_matchers/has_entries.rb
- lib/mocha/parameter_matchers/has_entry.rb
- lib/mocha/parameter_matchers/has_key.rb
@@ -205,7 +206,6 @@
- lib/mocha/parameter_matchers/not.rb
- lib/mocha/parameter_matchers/object.rb
- lib/mocha/parameter_matchers/optionally.rb
-- lib/mocha/parameter_matchers/query_string.rb
- lib/mocha/parameter_matchers/regexp_matches.rb
- lib/mocha/parameter_matchers/responds_with.rb
- lib/mocha/parameter_matchers/yaml_equivalent.rb
@@ -330,6 +330,7 @@
- test/unit/parameter_matchers/any_of_test.rb
- test/unit/parameter_matchers/anything_test.rb
- test/unit/parameter_matchers/equals_test.rb
+- test/unit/parameter_matchers/equivalent_uri_test.rb
- test/unit/parameter_matchers/has_entries_test.rb
- test/unit/parameter_matchers/has_entry_test.rb
- test/unit/parameter_matchers/has_key_test.rb
@@ -368,7 +369,7 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: '0'
+ version: 1.8.7
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
@@ -376,7 +377,7 @@
version: '0'
requirements: []
rubyforge_project: mocha
-rubygems_version: 2.5.1
+rubygems_version: 2.6.12
signing_key:
specification_version: 3
summary: Mocking and stubbing library
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mocha.gemspec new/mocha.gemspec
--- old/mocha.gemspec 2016-10-15 15:09:06.000000000 +0200
+++ new/mocha.gemspec 2017-08-24 23:44:56.000000000 +0200
@@ -7,6 +7,7 @@
s.name = "mocha"
s.version = Mocha::VERSION
s.licenses = ['MIT', 'BSD-2-Clause']
+ s.required_ruby_version = '>= 1.8.7'
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["James Mead"]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/acceptance/failure_messages_test.rb new/test/acceptance/failure_messages_test.rb
--- old/test/acceptance/failure_messages_test.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/acceptance/failure_messages_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -58,7 +58,7 @@
test_result = run_as_test do
'Foo'.expects(:bar)
end
- assert_match Regexp.new("'Foo'"), test_result.failures[0].message
+ assert_match Regexp.new(%{"Foo"}), test_result.failures[0].message
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/acceptance/mock_with_initializer_block_test.rb new/test/acceptance/mock_with_initializer_block_test.rb
--- old/test/acceptance/mock_with_initializer_block_test.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/acceptance/mock_with_initializer_block_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -1,5 +1,6 @@
require File.expand_path('../acceptance_test_helper', __FILE__)
require 'mocha/setup'
+require 'deprecation_disabler'
class MockWithInitializerBlockTest < Mocha::TestCase
@@ -15,35 +16,41 @@
def test_should_expect_two_method_invocations_and_receive_both_of_them
test_result = run_as_test do
- mock = mock() do
- expects(:method_1)
- expects(:method_2)
+ DeprecationDisabler.disable_deprecations do
+ mock = mock() do
+ expects(:method_1)
+ expects(:method_2)
+ end
+ mock.method_1
+ mock.method_2
end
- mock.method_1
- mock.method_2
end
assert_passed(test_result)
end
def test_should_expect_two_method_invocations_but_receive_only_one_of_them
test_result = run_as_test do
- mock = mock() do
- expects(:method_1)
- expects(:method_2)
+ DeprecationDisabler.disable_deprecations do
+ mock = mock() do
+ expects(:method_1)
+ expects(:method_2)
+ end
+ mock.method_1
end
- mock.method_1
end
assert_failed(test_result)
end
def test_should_stub_methods
test_result = run_as_test do
- mock = mock() do
- stubs(:method_1).returns(1)
- stubs(:method_2).returns(2)
+ DeprecationDisabler.disable_deprecations do
+ mock = mock() do
+ stubs(:method_1).returns(1)
+ stubs(:method_2).returns(2)
+ end
+ assert_equal 1, mock.method_1
+ assert_equal 2, mock.method_2
end
- assert_equal 1, mock.method_1
- assert_equal 2, mock.method_2
end
assert_passed(test_result)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/acceptance/parameter_matcher_test.rb new/test/acceptance/parameter_matcher_test.rb
--- old/test/acceptance/parameter_matcher_test.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/acceptance/parameter_matcher_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -243,60 +243,24 @@
assert_failed(test_result)
end
- def test_should_match_parameter_that_has_identical_query_string
+ def test_should_match_parameter_that_is_equivalent_uri
test_result = run_as_test do
mock = mock()
- mock.expects(:method).with(has_equivalent_query_string('http://example.com/foo?a=1&b=2'))
+ mock.expects(:method).with(equivalent_uri('http://example.com/foo?b=2&a=1'))
mock.method('http://example.com/foo?a=1&b=2')
end
assert_passed(test_result)
end
- def test_should_match_parameter_that_has_rearranged_query_string
+ def test_should_not_match_parameter_that_is_not_equivalent
test_result = run_as_test do
mock = mock()
- mock.expects(:method).with(has_equivalent_query_string('http://example.com/foo?b=2&a=1'))
+ mock.expects(:method).with(equivalent_uri('http://example.com/foo?a=1'))
mock.method('http://example.com/foo?a=1&b=2')
end
- assert_passed(test_result)
- end
-
- def test_should_not_match_parameter_that_does_not_have_the_same_query_parameters
- test_result = run_as_test do
- mock = mock()
- mock.expects(:method).with(has_equivalent_query_string('http://example.com/foo?a=1'))
- mock.method('http://example.com/foo?a=1&b=2')
- end
- assert_failed(test_result)
- end
-
- def test_should_not_match_parameter_that_has_no_query_parameters_when_they_are_expected
- test_result = run_as_test do
- mock = mock()
- mock.expects(:method).with(has_equivalent_query_string('http://example.com/foo'))
- mock.method('http://example.com/foo?a=1&b=2')
- end
- assert_failed(test_result)
- end
-
- def test_should_not_match_parameter_that_has_the_same_query_string_bit_which_differs_otherwise
- test_result = run_as_test do
- mock = mock()
- mock.expects(:method).with(has_equivalent_query_string('http://a.example.com/foo?a=1&b=2'))
- mock.method('http://b.example.com/foo?a=1&b=2')
- end
assert_failed(test_result)
end
- def test_should_match_parameter_with_no_domain_or_scheme
- test_result = run_as_test do
- mock = mock()
- mock.expects(:method).with(has_equivalent_query_string('/foo?a=1&b=2'))
- mock.method('/foo?a=1&b=2')
- end
- assert_passed(test_result)
- end
-
def test_should_match_parameter_when_value_is_divisible_by_four
test_result = run_as_test do
mock = mock()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/acceptance/sequence_test.rb new/test/acceptance/sequence_test.rb
--- old/test/acceptance/sequence_test.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/acceptance/sequence_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -148,7 +148,7 @@
mock.first
end
assert_failed(test_result)
- assert_match Regexp.new("in sequence 'one'"), test_result.failures.first.message
+ assert_match Regexp.new(%{in sequence "one"}), test_result.failures.first.message
end
def test_should_allow_expectations_to_be_in_more_than_one_sequence
@@ -166,8 +166,8 @@
mock.second
end
assert_failed(test_result)
- assert_match Regexp.new("in sequence 'one'"), test_result.failures.first.message
- assert_match Regexp.new("in sequence 'two'"), test_result.failures.first.message
+ assert_match Regexp.new(%{in sequence "one"}), test_result.failures.first.message
+ assert_match Regexp.new(%{in sequence "two"}), test_result.failures.first.message
end
def test_should_have_shortcut_for_expectations_to_be_in_more_than_one_sequence
@@ -185,8 +185,8 @@
mock.second
end
assert_failed(test_result)
- assert_match Regexp.new("in sequence 'one'"), test_result.failures.first.message
- assert_match Regexp.new("in sequence 'two'"), test_result.failures.first.message
+ assert_match Regexp.new(%{in sequence "one"}), test_result.failures.first.message
+ assert_match Regexp.new(%{in sequence "two"}), test_result.failures.first.message
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/acceptance/stub_module_method_test.rb new/test/acceptance/stub_module_method_test.rb
--- old/test/acceptance/stub_module_method_test.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/acceptance/stub_module_method_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -14,7 +14,11 @@
end
def test_should_stub_method_within_test
- mod = Module.new { def self.my_module_method; :original_return_value; end }
+ mod = Module.new do
+ def self.my_module_method
+ :original_return_value
+ end
+ end
test_result = run_as_test do
mod.stubs(:my_module_method).returns(:new_return_value)
assert_equal :new_return_value, mod.my_module_method
@@ -23,7 +27,14 @@
end
def test_should_leave_stubbed_public_method_unchanged_after_test
- mod = Module.new { class << self; def my_module_method; :original_return_value; end; public :my_module_method; end }
+ mod = Module.new do
+ class << self
+ def my_module_method
+ :original_return_value
+ end
+ public :my_module_method
+ end
+ end
run_as_test do
mod.stubs(:my_module_method).returns(:new_return_value)
end
@@ -32,7 +43,17 @@
end
def test_should_leave_stubbed_protected_method_unchanged_after_test
- mod = Module.new { class << self; def my_module_method; :original_return_value; end; protected :my_module_method; def my_unprotected_module_method; my_module_method; end; end }
+ mod = Module.new do
+ class << self
+ def my_module_method
+ :original_return_value
+ end
+ protected :my_module_method
+ def my_unprotected_module_method
+ my_module_method
+ end
+ end
+ end
run_as_test do
mod.stubs(:my_module_method).returns(:new_return_value)
end
@@ -41,7 +62,14 @@
end
def test_should_leave_stubbed_private_method_unchanged_after_test
- mod = Module.new { class << self; def my_module_method; :original_return_value; end; private :my_module_method; end }
+ mod = Module.new do
+ class << self
+ def my_module_method
+ :original_return_value
+ end
+ private :my_module_method
+ end
+ end
run_as_test do
mod.stubs(:my_module_method).returns(:new_return_value)
end
@@ -50,7 +78,11 @@
end
def test_should_reset_expectations_after_test
- mod = Module.new { def self.my_module_method; :original_return_value; end }
+ mod = Module.new do
+ def self.my_module_method
+ :original_return_value
+ end
+ end
run_as_test do
mod.stubs(:my_module_method)
end
@@ -58,8 +90,14 @@
end
def test_should_be_able_to_stub_a_superclass_method
- supermod = Module.new { def self.my_superclass_method; :original_return_value; end }
- mod = Module.new { include supermod }
+ supermod = Module.new do
+ def self.my_superclass_method
+ :original_return_value
+ end
+ end
+ mod = Module.new do
+ include supermod
+ end
test_result = run_as_test do
mod.stubs(:my_superclass_method).returns(:new_return_value)
assert_equal :new_return_value, mod.my_superclass_method
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/acceptance/stubba_test_result_test.rb new/test/acceptance/stubba_test_result_test.rb
--- old/test/acceptance/stubba_test_result_test.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/acceptance/stubba_test_result_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -16,7 +16,10 @@
def test_should_include_expectation_verification_in_assertion_count
test_result = run_as_test do
- object = Class.new { def message; end }.new
+ object = Class.new do
+ def message
+ end
+ end.new
object.expects(:message)
object.message
end
@@ -32,7 +35,10 @@
def test_should_not_include_stubbing_expectation_verification_in_assertion_count
test_result = run_as_test do
- object = Class.new { def message; end }.new
+ object = Class.new do
+ def message
+ end
+ end.new
object.stubs(:message)
object.message
end
@@ -41,7 +47,10 @@
def test_should_include_expectation_verification_failure_in_failure_count
test_result = run_as_test do
- object = Class.new { def message; end }.new
+ object = Class.new do
+ def message
+ end
+ end.new
object.expects(:message)
end
assert_equal 1, test_result.failure_count
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/acceptance/stubbing_on_non_mock_object_test.rb new/test/acceptance/stubbing_on_non_mock_object_test.rb
--- old/test/acceptance/stubbing_on_non_mock_object_test.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/acceptance/stubbing_on_non_mock_object_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -15,7 +15,10 @@
def test_should_allow_stubbing_method_on_non_mock_object
Mocha::Configuration.allow(:stubbing_method_on_non_mock_object)
- non_mock_object = Class.new { def existing_method; end }
+ non_mock_object = Class.new do
+ def existing_method
+ end
+ end
test_result = run_as_test do
non_mock_object.stubs(:existing_method)
end
@@ -25,7 +28,10 @@
def test_should_warn_on_stubbing_method_on_non_mock_object
Mocha::Configuration.warn_when(:stubbing_method_on_non_mock_object)
- non_mock_object = Class.new { def existing_method; end }
+ non_mock_object = Class.new do
+ def existing_method
+ end
+ end
test_result = run_as_test do
non_mock_object.stubs(:existing_method)
end
@@ -35,7 +41,10 @@
def test_should_prevent_stubbing_method_on_non_mock_object
Mocha::Configuration.prevent(:stubbing_method_on_non_mock_object)
- non_mock_object = Class.new { def existing_method; end }
+ non_mock_object = Class.new do
+ def existing_method
+ end
+ end
test_result = run_as_test do
non_mock_object.stubs(:existing_method)
end
@@ -44,7 +53,10 @@
end
def test_should_default_to_allow_stubbing_method_on_non_mock_object
- non_mock_object = Class.new { def existing_method; end }
+ non_mock_object = Class.new do
+ def existing_method
+ end
+ end
test_result = run_as_test do
non_mock_object.stubs(:existing_method)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/deprecation_disabler.rb new/test/deprecation_disabler.rb
--- old/test/deprecation_disabler.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/deprecation_disabler.rb 2017-08-24 23:44:57.000000000 +0200
@@ -12,4 +12,5 @@
end
end
+ module_function :disable_deprecations
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/execution_point.rb new/test/execution_point.rb
--- old/test/execution_point.rb 2016-10-15 15:09:06.000000000 +0200
+++ new/test/execution_point.rb 2017-08-24 23:44:57.000000000 +0200
@@ -10,14 +10,16 @@
@backtrace = backtrace
end
+ def first_relevant_line_of_backtrace
+ @backtrace && (@backtrace.reject { |l| /\Aorg\/jruby\//.match(l) }.first || 'unknown:0')
+ end
+
def file_name
- return "unknown" unless @backtrace && @backtrace.first
- /\A(.*?):\d+/.match(@backtrace.first)[1]
+ /\A(.*?):\d+/.match(first_relevant_line_of_backtrace)[1]
end
def line_number
- return "unknown" unless @backtrace && @backtrace.first
- Integer(/\A.*?:(\d+)/.match(@backtrace.first)[1])
+ Integer(/\A.*?:(\d+)/.match(first_relevant_line_of_backtrace)[1])
end
def ==(other)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/any_instance_method_test.rb new/test/unit/any_instance_method_test.rb
--- old/test/unit/any_instance_method_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/any_instance_method_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -76,6 +76,7 @@
klass.define_instance_method(:any_instance) { any_instance }
method = AnyInstanceMethod.new(klass, :method_x)
method.replace_instance_method(:restore_original_method) { }
+ method.replace_instance_method(:reset_mocha) { }
method.define_instance_accessor(:remove_called)
method.replace_instance_method(:remove_new_method) { self.remove_called = true }
@@ -92,6 +93,7 @@
klass.define_instance_method(:any_instance) { any_instance }
method = AnyInstanceMethod.new(klass, :method_x)
method.replace_instance_method(:remove_new_method) { }
+ method.replace_instance_method(:reset_mocha) { }
method.define_instance_accessor(:restore_called)
method.replace_instance_method(:restore_original_method) { self.restore_called = true }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/array_inspect_test.rb new/test/unit/array_inspect_test.rb
--- old/test/unit/array_inspect_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/array_inspect_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -10,7 +10,7 @@
def test_should_use_mocha_inspect_on_each_item
array = [1, 2, "chris"]
- assert_equal "[1, 2, 'chris']", array.mocha_inspect
+ assert_equal %{[1, 2, "chris"]}, array.mocha_inspect
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/class_method_test.rb new/test/unit/class_method_test.rb
--- old/test/unit/class_method_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/class_method_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -11,6 +11,7 @@
unless RUBY_V2_PLUS
def test_should_hide_original_method
klass = Class.new { def self.method_x; end }
+ klass.__metaclass__.send(:alias_method, :_method, :method)
method = ClassMethod.new(klass, :method_x)
method.hide_original_method
@@ -59,6 +60,7 @@
def test_should_restore_original_method
klass = Class.new { def self.method_x; :original_result; end }
+ klass.__metaclass__.send(:alias_method, :_method, :method)
method = ClassMethod.new(klass, :method_x)
method.hide_original_method
@@ -72,6 +74,7 @@
def test_should_restore_original_method_accepting_a_block_parameter
klass = Class.new { def self.method_x(&block); block.call if block_given? ; end }
+ klass.__metaclass__.send(:alias_method, :_method, :method)
method = ClassMethod.new(klass, :method_x)
method.hide_original_method
@@ -121,6 +124,7 @@
method = ClassMethod.new(klass, :method_x)
mocha = build_mock
klass.define_instance_method(:mocha) { mocha }
+ method.replace_instance_method(:reset_mocha) { }
method.define_instance_accessor(:remove_called)
method.replace_instance_method(:remove_new_method) { self.remove_called = true }
@@ -134,6 +138,7 @@
mocha = build_mock
klass.define_instance_method(:mocha) { mocha }
method = ClassMethod.new(klass, :method_x)
+ method.replace_instance_method(:reset_mocha) { }
method.define_instance_accessor(:restore_called)
method.replace_instance_method(:restore_original_method) { self.restore_called = true }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/expectation_test.rb new/test/unit/expectation_test.rb
--- old/test/unit/expectation_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/expectation_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -343,7 +343,7 @@
sequence_two = Sequence.new('two')
expectation = Expectation.new(mock, :expected_method).with(1, 2, {'a' => true}, {:b => false}, [1, 2, 3]).in_sequence(sequence_one, sequence_two)
assert !expectation.verified?
- assert_match "mock.expected_method(1, 2, {'a' => true}, {:b => false}, [1, 2, 3]); in sequence 'one'; in sequence 'two'", expectation.mocha_inspect
+ assert_match %{mock.expected_method(1, 2, {"a" => true}, {:b => false}, [1, 2, 3]); in sequence "one"; in sequence "two"}, expectation.mocha_inspect
end
class FakeConstraint
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/hash_inspect_test.rb new/test/unit/hash_inspect_test.rb
--- old/test/unit/hash_inspect_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/hash_inspect_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -10,7 +10,7 @@
def test_should_use_mocha_inspect_on_each_item
hash = {:a => 'mocha'}
- assert_equal "{:a => 'mocha'}", hash.mocha_inspect
+ assert_equal %{{:a => "mocha"}}, hash.mocha_inspect
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/mockery_test.rb new/test/unit/mockery_test.rb
--- old/test/unit/mockery_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/mockery_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -2,10 +2,12 @@
require 'mocha/mockery'
require 'mocha/state_machine'
require 'mocha/expectation_error_factory'
+require 'deprecation_disabler'
class MockeryTest < Mocha::TestCase
include Mocha
+ include DeprecationDisabler
def test_should_build_instance_of_mockery
mockery = Mockery.instance
@@ -28,16 +30,20 @@
def test_should_raise_expectation_error_because_not_all_expectations_are_satisfied
mockery = Mockery.new
- mock_1 = mockery.named_mock('mock-1') { expects(:method_1) }
- mock_2 = mockery.named_mock('mock-2') { expects(:method_2) }
- 1.times { mock_1.method_1 }
- 0.times { mock_2.method_2 }
+ disable_deprecations do
+ mock_1 = mockery.named_mock('mock-1') { expects(:method_1) }
+ mock_2 = mockery.named_mock('mock-2') { expects(:method_2) }
+ 1.times { mock_1.method_1 }
+ 0.times { mock_2.method_2 }
+ end
assert_raises(ExpectationErrorFactory.exception_class) { mockery.verify }
end
def test_should_reset_list_of_mocks_on_teardown
mockery = Mockery.new
- mockery.unnamed_mock { expects(:my_method) }
+ disable_deprecations do
+ mockery.unnamed_mock { expects(:my_method) }
+ end
mockery.teardown
assert_nothing_raised(ExpectationErrorFactory.exception_class) { mockery.verify }
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/parameter_matchers/equals_test.rb new/test/unit/parameter_matchers/equals_test.rb
--- old/test/unit/parameter_matchers/equals_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/parameter_matchers/equals_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -19,7 +19,7 @@
def test_should_describe_matcher
matcher = equals('x')
- assert_equal "'x'", matcher.mocha_inspect
+ assert_equal %{"x"}, matcher.mocha_inspect
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/parameter_matchers/equivalent_uri_test.rb new/test/unit/parameter_matchers/equivalent_uri_test.rb
--- old/test/unit/parameter_matchers/equivalent_uri_test.rb 1970-01-01 01:00:00.000000000 +0100
+++ new/test/unit/parameter_matchers/equivalent_uri_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -0,0 +1,51 @@
+require File.expand_path('../../../test_helper', __FILE__)
+require 'deprecation_disabler'
+require 'mocha/parameter_matchers/equivalent_uri'
+
+class EquivalentUriMatchesTest < Mocha::TestCase
+
+ include Mocha::ParameterMatchers
+ include DeprecationDisabler
+
+ def test_should_match_identical_uri
+ matcher = equivalent_uri('http://example.com/foo?a=1&b=2')
+ assert matcher.matches?(['http://example.com/foo?a=1&b=2'])
+ end
+
+ def test_should_support_legacy_matcher_method
+ disable_deprecations do
+ matcher = has_equivalent_query_string('http://example.com/foo?a=1&b=2')
+ assert matcher.matches?(['http://example.com/foo?a=1&b=2'])
+ end
+ end
+
+ def test_should_match_uri_with_rearranged_query_string
+ matcher = equivalent_uri('http://example.com/foo?b=2&a=1')
+ assert matcher.matches?(['http://example.com/foo?a=1&b=2'])
+ end
+
+ def test_should_not_match_uri_with_different_query_string
+ matcher = equivalent_uri('http://example.com/foo?a=1')
+ assert !matcher.matches?(['http://example.com/foo?a=1&b=2'])
+ end
+
+ def test_should_not_match_uri_when_no_query_string_expected
+ matcher = equivalent_uri('http://example.com/foo')
+ assert !matcher.matches?(['http://example.com/foo?a=1&b=2'])
+ end
+
+ def test_should_not_match_uri_with_different_domain
+ matcher = equivalent_uri('http://a.example.com/foo?a=1&b=2')
+ assert !matcher.matches?(['http://b.example.com/foo?a=1&b=2'])
+ end
+
+ def test_should_match_uri_without_scheme_and_domain
+ matcher = equivalent_uri('/foo?a=1&b=2')
+ assert matcher.matches?(['/foo?a=1&b=2'])
+ end
+
+ def test_should_match_uri_with_query_string_containing_blank_value
+ matcher = equivalent_uri('http://example.com/foo?a=&b=2')
+ assert matcher.matches?(['http://example.com/foo?a=&b=2'])
+ end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/parameter_matchers/has_entry_test.rb new/test/unit/parameter_matchers/has_entry_test.rb
--- old/test/unit/parameter_matchers/has_entry_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/parameter_matchers/has_entry_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -31,12 +31,12 @@
def test_should_describe_matcher_with_key_value_pair
matcher = has_entry(:key_1, 'value_1')
- assert_equal "has_entry(:key_1 => 'value_1')", matcher.mocha_inspect
+ assert_equal %{has_entry(:key_1 => "value_1")}, matcher.mocha_inspect
end
def test_should_describe_matcher_with_entry
matcher = has_entry(:key_1 => 'value_1')
- assert_equal "has_entry(:key_1 => 'value_1')", matcher.mocha_inspect
+ assert_equal %{has_entry(:key_1 => "value_1")}, matcher.mocha_inspect
end
def test_should_match_hash_including_specified_entry_with_nested_key_matcher
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/parameter_matchers/has_value_test.rb new/test/unit/parameter_matchers/has_value_test.rb
--- old/test/unit/parameter_matchers/has_value_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/parameter_matchers/has_value_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -21,7 +21,7 @@
def test_should_describe_matcher
matcher = has_value('value_1')
- assert_equal "has_value('value_1')", matcher.mocha_inspect
+ assert_equal %{has_value("value_1")}, matcher.mocha_inspect
end
def test_should_match_hash_including_specified_value_with_nested_value_matcher
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/parameter_matchers/includes_test.rb new/test/unit/parameter_matchers/includes_test.rb
--- old/test/unit/parameter_matchers/includes_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/parameter_matchers/includes_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -15,6 +15,11 @@
assert matcher.matches?([[:x, :y, :z]])
end
+ def test_should_match_object_including_array_value
+ matcher = includes([:x])
+ assert matcher.matches?([[[:x], [:y], [:z]]])
+ end
+
def test_should_match_object_including_all_values
matcher = includes(:x, :y, :z)
assert matcher.matches?([[:x, :y, :z]])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/sequence_test.rb new/test/unit/sequence_test.rb
--- old/test/unit/sequence_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/sequence_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -98,7 +98,7 @@
sequence = Sequence.new('wibble')
expectation = FakeExpectation.new
sequence.constrain_as_next_in_sequence(expectation)
- assert_equal "in sequence 'wibble'", expectation.ordering_constraints[0].mocha_inspect
+ assert_equal %{in sequence "wibble"}, expectation.ordering_constraints[0].mocha_inspect
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/unit/string_inspect_test.rb new/test/unit/string_inspect_test.rb
--- old/test/unit/string_inspect_test.rb 2016-10-15 15:09:07.000000000 +0200
+++ new/test/unit/string_inspect_test.rb 2017-08-24 23:44:57.000000000 +0200
@@ -3,9 +3,9 @@
class StringInspectTest < Mocha::TestCase
- def test_should_replace_escaped_quotes_with_single_quote
+ def test_should_use_default_inspect_method
string = "my_string"
- assert_equal "'my_string'", string.mocha_inspect
+ assert_equal %{"my_string"}, string.mocha_inspect
end
end
1
0
Hello community,
here is the log from the commit of package python-Trolly for openSUSE:Factory checked in at 2017-09-04 12:31:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Trolly (Old)
and /work/SRC/openSUSE:Factory/.python-Trolly.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Trolly"
Mon Sep 4 12:31:46 2017 rev:6 rq:519857 version:0.2.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Trolly/python-Trolly.changes 2015-05-18 22:35:22.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-Trolly.new/python-Trolly.changes 2017-09-04 12:31:47.929675923 +0200
@@ -1,0 +2,11 @@
+Thu Aug 31 07:07:44 UTC 2017 - toddrme2178(a)gmail.com
+
+- update to version 0.2.2
+ * No upstream changelog
+
+-------------------------------------------------------------------
+Thu Aug 24 13:56:23 UTC 2017 - jmatejek(a)suse.com
+
+- singlespec auto-conversion
+
+-------------------------------------------------------------------
@@ -24,0 +36 @@
+
Old:
----
Trolly-0.2.1.zip
New:
----
Trolly-0.2.2.zip
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Trolly.spec ++++++
--- /var/tmp/diff_new_pack.W1GYU8/_old 2017-09-04 12:31:48.801553337 +0200
+++ /var/tmp/diff_new_pack.W1GYU8/_new 2017-09-04 12:31:48.805552774 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-Trolly
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,26 +16,27 @@
#
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%bcond_with test
Name: python-Trolly
-Version: 0.2.1
+Version: 0.2.2
Release: 0
Summary: Trello api
License: MIT
Group: Development/Languages/Python
Url: https://github.com/plish/Trolly
-Source: http://pypi.python.org/packages/source/T/Trolly/Trolly-%{version}.zip
-BuildRequires: python-devel
+Source: https://files.pythonhosted.org/packages/source/T/Trolly/Trolly-%{version}.z…
+BuildRequires: %{python_module devel}
+BuildRequires: python-rpm-macros
BuildRequires: unzip
-## Test requirements:
-#BuildRequires: python-nose
-#BuildRequires: python-httplib2
+%if %{with test}
+BuildRequires: %{python_module nose}
+BuildRequires: %{python_module httplib2}
+%endif
Requires: python-httplib2
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
BuildArch: noarch
-%endif
+
+%python_subpackages
%description
A Python wrapper around the Trello API. Provides a group of Python classes to represent Trello Objects. None of the
@@ -48,15 +49,17 @@
%setup -q -n Trolly-%{version}
%build
-python setup.py build
+%python_build
%install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%python_install
-#%%check
-#nosetests
+%if %{with test}
+%check
+%python_expand nosetests-%{$python_bin_suffix}
+%endif
-%files
+%files %{python_files}
%defattr(-,root,root,-)
%{python_sitelib}/*
1
0
Hello community,
here is the log from the commit of package python-lesscpy for openSUSE:Factory checked in at 2017-09-04 12:31:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-lesscpy (Old)
and /work/SRC/openSUSE:Factory/.python-lesscpy.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-lesscpy"
Mon Sep 4 12:31:31 2017 rev:7 rq:519853 version:0.12.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-lesscpy/python-lesscpy.changes 2016-08-17 12:05:34.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-lesscpy.new/python-lesscpy.changes 2017-09-04 12:31:39.310887726 +0200
@@ -1,0 +2,11 @@
+Thu Aug 31 06:55:58 UTC 2017 - toddrme2178(a)gmail.com
+
+- update to 0.12.0
+ * no changelog available
+
+-------------------------------------------------------------------
+Thu Aug 24 13:44:20 UTC 2017 - jmatejek(a)suse.com
+
+- singlespec auto-conversion
+
+-------------------------------------------------------------------
@@ -42,0 +54 @@
+
Old:
----
lesscpy-0.10.2.tar.gz
New:
----
lesscpy-0.12.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-lesscpy.spec ++++++
--- /var/tmp/diff_new_pack.4ejwrH/_old 2017-09-04 12:31:40.266753332 +0200
+++ /var/tmp/diff_new_pack.4ejwrH/_new 2017-09-04 12:31:40.282751083 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-lesscpy
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,32 +16,29 @@
#
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-lesscpy
-Version: 0.10.2
+Version: 0.12.0
Release: 0
-Url: https://github.com/robotis/lesscpy
Summary: Lesscss compiler
License: MIT
Group: Development/Languages/Python
-Source: http://pypi.python.org/packages/source/l/lesscpy/lesscpy-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: python-devel
-BuildRequires: python-ply
-BuildRequires: python-setuptools
-BuildRequires: python-six
-# Test requirements:
-BuildRequires: python-coverage
-BuildRequires: python-flake8
-BuildRequires: python-nose
+Url: https://github.com/robotis/lesscpy
+Source: https://files.pythonhosted.org/packages/source/l/lesscpy/lesscpy-%{version}…
+BuildRequires: %{python_module coverage}
+BuildRequires: %{python_module devel}
+BuildRequires: %{python_module flake8}
+BuildRequires: %{python_module nose}
+BuildRequires: %{python_module ply}
+BuildRequires: %{python_module setuptools}
+BuildRequires: %{python_module six}
+BuildRequires: python-rpm-macros
Requires: python-ply
Requires: python-six
-Requires(post): update-alternatives
-Requires(preun): update-alternatives
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
BuildArch: noarch
-%endif
+Requires(post): update-alternatives
+Requires(postun): update-alternatives
+%python_subpackages
%description
python LessCss Compiler.
@@ -58,33 +55,26 @@
rm test/test_{bootstrap3,less,issues}.py
%build
-python setup.py build
+%python_build
%install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
-mkdir -p %{buildroot}%{_sysconfdir}/alternatives
-mv %{buildroot}%{_bindir}/lesscpy %{buildroot}%{_bindir}/lesscpy-%{py_ver}
-ln -sf %{_sysconfdir}/alternatives/lesscpy %{buildroot}%{_bindir}/lesscpy
-
-%check
-python setup.py -q test
+%python_install
+%python_clone -a %{buildroot}%{_bindir}/lesscpy
%post
-%_sbindir/update-alternatives \
- --install %{_bindir}/lesscpy lesscpy %{_bindir}/lesscpy-%{py_ver} 20
+%python_install_alternative lesscpy
-%preun
-if [ $1 -eq 0 ] ; then
- %_sbindir/update-alternatives --remove lesscpy %{_bindir}/lesscpy-%{py_ver}
-fi
+%postun
+%python_uninstall_alternative lesscpy
+
+%check
+%python_exec setup.py test
-%files
+%files %{python_files}
%defattr(-,root,root,-)
%doc LICENSE README.rst
-%{_bindir}/lesscpy
-%{_bindir}/lesscpy-%{py_ver}
-%ghost %{_sysconfdir}/alternatives/lesscpy
+%python_alternative %{_bindir}/lesscpy
%{python_sitelib}/lesscpy
-%{python_sitelib}/lesscpy-%{version}-py%{py_ver}.egg-info
+%{python_sitelib}/lesscpy-%{version}-py*.egg-info
%changelog
++++++ lesscpy-0.10.2.tar.gz -> lesscpy-0.12.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/PKG-INFO new/lesscpy-0.12.0/PKG-INFO
--- old/lesscpy-0.10.2/PKG-INFO 2014-11-26 21:50:54.000000000 +0100
+++ new/lesscpy-0.12.0/PKG-INFO 2016-10-04 13:18:23.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: lesscpy
-Version: 0.10.2
+Version: 0.12.0
Summary: Python LESS compiler
Home-page: https://github.com/lesscpy/lesscpy
Author: Jóhann T Maríusson
@@ -38,7 +38,7 @@
input and is considerably slower than the NodeJS compiler. The plan is to
utilize this to build in proper syntax checking and perhaps YUI compressing.
- This is an early version, so you are likly to find bugs.
+ This is an early version, so you are likely to find bugs.
For more information on LESS:
http://lesscss.org/ or https://github.com/cloudhead/less.js
@@ -63,7 +63,6 @@
- Color functions (lighten, darken, saturate, desaturate, spin, hue, mix,
saturation, lightness)
- Other functions (round, increment, decrement, format '%(', ...)
- - Keyframe blocks
Differences from less.js
@@ -82,7 +81,7 @@
Requirements
------------
- - Python 2.6, 2.7, or 3.3
+ - Python 2.6, 2.7, 3.3, 3.4, or 3.5
- ply (Python Lex-Yacc) (check requirements.txt)
@@ -189,5 +188,6 @@
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Pre-processors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/README.rst new/lesscpy-0.12.0/README.rst
--- old/lesscpy-0.10.2/README.rst 2014-11-26 21:28:11.000000000 +0100
+++ new/lesscpy-0.12.0/README.rst 2016-10-04 11:49:17.000000000 +0200
@@ -30,7 +30,7 @@
input and is considerably slower than the NodeJS compiler. The plan is to
utilize this to build in proper syntax checking and perhaps YUI compressing.
-This is an early version, so you are likly to find bugs.
+This is an early version, so you are likely to find bugs.
For more information on LESS:
http://lesscss.org/ or https://github.com/cloudhead/less.js
@@ -55,7 +55,6 @@
- Color functions (lighten, darken, saturate, desaturate, spin, hue, mix,
saturation, lightness)
- Other functions (round, increment, decrement, format '%(', ...)
-- Keyframe blocks
Differences from less.js
@@ -74,7 +73,7 @@
Requirements
------------
-- Python 2.6, 2.7, or 3.3
+- Python 2.6, 2.7, 3.3, 3.4, or 3.5
- ply (Python Lex-Yacc) (check requirements.txt)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/__init__.py new/lesscpy-0.12.0/lesscpy/__init__.py
--- old/lesscpy-0.10.2/lesscpy/__init__.py 2014-11-26 21:30:47.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/__init__.py 2016-10-04 13:09:38.000000000 +0200
@@ -1,4 +1,4 @@
-__version_info__ = ('0', '10', '2')
+__version_info__ = ('0', '12', '0')
__version__ = '.'.join(__version_info__)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/lessc/color.py new/lesscpy-0.12.0/lesscpy/lessc/color.py
--- old/lesscpy-0.10.2/lesscpy/lessc/color.py 2014-11-26 21:28:11.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/lessc/color.py 2016-10-04 11:49:17.000000000 +0200
@@ -12,6 +12,7 @@
import colorsys
import re
+import six
from . import utility
from lesscpy.lib import colors
@@ -35,7 +36,7 @@
v = 0xff
if v < 0:
v = 0
- r.append("%02x" % v)
+ r.append("%02x" % int(v))
return ''.join(r)
def operate(self, left, right, operation):
@@ -303,7 +304,7 @@
str
"""
if color and degree:
- if isinstance(degree, str):
+ if isinstance(degree, six.string_types):
degree = float(degree.strip('%'))
h, l, s = self._hextohls(color)
h = ((h * 360.0) + degree) % 360.0
@@ -347,7 +348,7 @@
str
"""
if color1 and color2:
- if isinstance(weight, str):
+ if isinstance(weight, six.string_types):
weight = float(weight.strip('%'))
weight = ((weight / 100.0) * 2) - 1
rgb1 = self._hextorgb(color1)
@@ -383,14 +384,12 @@
raise ValueError('Cannot format non-color')
def _rgbatohex_raw(self, rgba):
- values = ["%x" % v for v in [0xff
- if h > 0xff else
- 0 if h < 0 else h
- for h in rgba]]
+ values = ["%x" % int(v) for v in
+ [0xff if h > 0xff else 0 if h < 0 else h for h in rgba]]
return values
def _rgbatohex(self, rgba):
- return '#%s' % ''.join(["%02x" % v for v in
+ return '#%s' % ''.join(["%02x" % int(v) for v in
[0xff
if h > 0xff else
0 if h < 0 else h
@@ -418,7 +417,7 @@
return colorsys.rgb_to_hls(*[c / 255.0 for c in rgb])
def _ophsl(self, color, diff, idx, operation):
- if isinstance(diff, str):
+ if isinstance(diff, six.string_types):
diff = float(diff.strip('%'))
hls = list(self._hextohls(color))
hls[idx] = self._clamp(operation(hls[idx], diff / 100.0))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/lessc/lexer.py new/lesscpy-0.12.0/lesscpy/lessc/lexer.py
--- old/lesscpy-0.10.2/lesscpy/lessc/lexer.py 2014-11-26 21:28:11.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/lessc/lexer.py 2016-10-04 11:49:17.000000000 +0200
@@ -46,6 +46,7 @@
'css_vendor_hack',
'css_uri',
'css_ms_filter',
+ 'css_keyframe_selector',
'css_media_type',
'css_media_feature',
@@ -108,7 +109,7 @@
def t_css_filter(self, t):
(r'\[[^\]]*\]'
'|(not|lang|nth-[a-z\-]+)\(.+\)'
- '|and[ \t]\([^><\{]+\)')
+ '|and[ \t]\([^><=\{]+\)')
return t
def t_css_ms_filter(self, t):
@@ -173,6 +174,8 @@
t.type = 'less_and'
elif v == 'not':
t.type = 'less_not'
+ elif v in ('from', 'to'):
+ t.type = 'css_keyframe_selector'
elif v in css.propertys:
t.type = 'css_property'
t.lexer.in_property_decl = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/lessc/parser.py new/lesscpy-0.12.0/lesscpy/lessc/parser.py
--- old/lesscpy-0.10.2/lesscpy/lessc/parser.py 2014-11-26 21:28:11.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/lessc/parser.py 2016-10-04 11:49:17.000000000 +0200
@@ -18,13 +18,14 @@
import tempfile
import sys
import ply.yacc
+import six
from . import lexer
from . import utility
from .scope import Scope
from .color import Color
from lesscpy.exceptions import CompilationError
-from lesscpy.plib import Block, Call, Deferred, Expression, Identifier, Mixin, Property, Statement, Variable, Import
+from lesscpy.plib import Block, Call, Deferred, Expression, Identifier, Mixin, NegatedExpression, Property, Statement, Variable, Import, KeyframeSelector
class ErrorRegister(object):
"""
@@ -142,7 +143,7 @@
if filename is not None:
raise AssertionError(
'names of file and filename are in conflict')
- filename = file.name()
+ filename = file.name
else:
filename = '(stream)'
@@ -235,7 +236,7 @@
if self.importlvl > 8:
raise ImportError(
'Recrusive import level too deep > 8 (circular import ?)')
- if isinstance(p[3], str):
+ if isinstance(p[3], six.string_types):
ipath = utility.destring(p[3])
elif isinstance(p[3], list):
p[3] = Import(p[3], p.lineno(4)).parse(self.scope)
@@ -310,6 +311,12 @@
"""
p[0] = Identifier([p[1], p[2]]).parse(self.scope)
+ def p_keyframe_open(self, p):
+ """block_open : css_keyframe_selector brace_open
+ | number brace_open
+ """
+ p[0] = KeyframeSelector([p[1]]).parse(self.scope)
+
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
@@ -784,7 +791,7 @@
def p_expression_p_neg(self, p):
""" expression : '-' t_popen expression t_pclose
"""
- p[0] = [p[1], p[3]]
+ p[0] = NegatedExpression([p[3]], 0)
def p_expression_p(self, p):
""" expression : t_popen expression t_pclose
@@ -1046,4 +1053,3 @@
t(str): Error type
"""
self.register.register("%s: line: %d: %s\n" % (t, line, e))
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/lessc/scope.py new/lesscpy-0.12.0/lesscpy/lessc/scope.py
--- old/lesscpy-0.10.2/lesscpy/lessc/scope.py 2014-02-02 18:34:18.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/lessc/scope.py 2016-10-04 11:49:17.000000000 +0200
@@ -7,6 +7,8 @@
See LICENSE for details.
.. moduleauthor:: Johann T. Mariusson <jtm(a)robot.is>
"""
+import six
+
from . import utility
@@ -193,12 +195,8 @@
var = self.variables('@' + name[2:-1])
if var is False:
raise SyntaxError('Unknown escaped variable %s' % name)
- try:
- if isinstance(var.value[0], basestring): # py3
- var.value[0] = utility.destring(var.value[0])
- except NameError:
- if isinstance(var.value[0], str): # py2
- var.value[0] = utility.destring(var.value[0])
+ if isinstance(var.value[0], six.string_types):
+ var.value[0] = utility.destring(var.value[0])
else:
var = self.variables(name)
if var is False:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/lib/dom.py new/lesscpy-0.12.0/lesscpy/lib/dom.py
--- old/lesscpy-0.10.2/lesscpy/lib/dom.py 2014-02-02 13:23:27.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/lib/dom.py 2016-10-04 11:49:17.000000000 +0200
@@ -158,15 +158,6 @@
'tspan',
]
-# Check http://www.w3.org/TR/css3-animations/#keyframes
-# Treating them as DOM elements isn't entirely accurate
-# but sufficent for our purposes.
-css3_animation_keyframe_selectors = [
- 'from',
- 'to'
-]
-
elements = html4
elements.extend(html5)
elements.extend(svg)
-elements.extend(css3_animation_keyframe_selectors)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/plib/__init__.py new/lesscpy-0.12.0/lesscpy/plib/__init__.py
--- old/lesscpy-0.10.2/lesscpy/plib/__init__.py 2014-11-26 21:28:11.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/plib/__init__.py 2016-10-04 11:49:17.000000000 +0200
@@ -13,7 +13,9 @@
'Deferred',
'Expression',
'Identifier',
+ 'KeyframeSelector',
'Mixin',
+ 'NegatedExpression',
'Node',
'Property',
'Statement',
@@ -25,7 +27,9 @@
from .deferred import Deferred
from .expression import Expression
from .identifier import Identifier
+from .keyframe_selector import KeyframeSelector
from .mixin import Mixin
+from .negated_expression import NegatedExpression
from .node import Node
from .property import Property
from .statement import Statement
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/plib/call.py new/lesscpy-0.12.0/lesscpy/plib/call.py
--- old/lesscpy-0.10.2/lesscpy/plib/call.py 2014-02-02 18:34:18.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/plib/call.py 2016-10-04 11:49:17.000000000 +0200
@@ -13,6 +13,7 @@
from urllib.parse import quote as urlquote
except ImportError:
from urllib import quote as urlquote
+import six
from .node import Node
import lesscpy.lessc.utility as utility
import lesscpy.lessc.color as Color
@@ -45,7 +46,7 @@
name = 'escape'
color = Color.Color()
args = [t for t in parsed
- if not isinstance(t, str) or t not in '(),']
+ if not isinstance(t, six.string_types) or t not in '(),']
if hasattr(self, name):
try:
return getattr(self, name)(*args)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/plib/expression.py new/lesscpy-0.12.0/lesscpy/plib/expression.py
--- old/lesscpy-0.10.2/lesscpy/plib/expression.py 2014-02-02 18:34:18.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/plib/expression.py 2016-10-04 11:49:17.000000000 +0200
@@ -18,7 +18,8 @@
class Expression(Node):
"""Expression node. Parses all expression except
- color expressions, (handled in the color class)
+ color expressions (handled in the color class)
+ and unary negation (handled in the NegatedExpression class).
"""
def parse(self, scope):
@@ -32,7 +33,6 @@
"""
assert(len(self.tokens) == 3)
expr = self.process(self.tokens, scope)
- expr = [self.neg(t, scope) for t in expr]
A, O, B = [e[0]
if isinstance(e, tuple)
else e
@@ -55,25 +55,6 @@
return out
return self.with_units(out, ua, ub)
- def neg(self, value, scope):
- """Apply negativity.
- args:
- value (mixed): test value
- scope (Scope): Current scope
- raises:
- SyntaxError
- returns:
- str
- """
- if value and isinstance(value, list) and value[0] == '-':
- val = value[1]
- if len(value) > 1 and hasattr(value[1], 'parse'):
- val = value[1].parse(scope)
- if isinstance(val, str):
- return '-' + val
- return -val
- return value
-
def with_units(self, val, ua, ub):
"""Return value with unit.
args:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/plib/keyframe_selector.py new/lesscpy-0.12.0/lesscpy/plib/keyframe_selector.py
--- old/lesscpy-0.10.2/lesscpy/plib/keyframe_selector.py 1970-01-01 01:00:00.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/plib/keyframe_selector.py 2016-10-04 11:49:17.000000000 +0200
@@ -0,0 +1,50 @@
+# -*- coding: utf8 -*-
+"""
+.. module:: lesscpy.plib.keyframe_selector
+ :synopsis: Keyframe selector node.
+
+ Copyright (c)
+ See LICENSE for details.
+"""
+
+from .node import Node
+
+
+class KeyframeSelector(Node):
+
+ """Keyframe selector node. Represents the keyframe selector in an animation
+ sequence. Keyframes can be identified by the keywords "from" or "to", or by
+ percentage.
+
+ http://www.w3.org/TR/css3-animations/#keyframes
+ """
+
+ def parse(self, scope):
+ """Parse node.
+ args:
+ scope (Scope): Current scope
+ raises:
+ SyntaxError
+ returns:
+ self
+ """
+ self.keyframe, = [e[0] if isinstance(e, tuple) else e
+ for e in self.tokens if str(e).strip()]
+ self.subparse = False
+ return self
+
+ def copy(self):
+ """ Return copy of self
+ Returns:
+ KeyframeSelector object
+ """
+ return KeyframeSelector(self.tokens, 0)
+
+ def fmt(self, fills):
+ """Format identifier
+ args:
+ fills (dict): replacements
+ returns:
+ str (CSS)
+ """
+ return self.keyframe
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/plib/negated_expression.py new/lesscpy-0.12.0/lesscpy/plib/negated_expression.py
--- old/lesscpy-0.10.2/lesscpy/plib/negated_expression.py 1970-01-01 01:00:00.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/plib/negated_expression.py 2016-10-04 11:49:17.000000000 +0200
@@ -0,0 +1,23 @@
+# -*- coding: utf8 -*-
+"""
+.. module:: lesscpy.plib.negated_expression
+ :synopsis: Node for unary negated expressions.
+
+ Copyright (c)
+ See LICENSE for details.
+"""
+
+import six
+
+from .node import Node
+
+
+class NegatedExpression(Node):
+
+ """Expressions preceded by unary negation."""
+
+ def parse(self, scope):
+ val, = self.process(self.tokens, scope)
+ if isinstance(val, six.string_types):
+ return '-' + val
+ return -val
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy/scripts/compiler.py new/lesscpy-0.12.0/lesscpy/scripts/compiler.py
--- old/lesscpy-0.10.2/lesscpy/scripts/compiler.py 2014-01-21 12:07:38.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy/scripts/compiler.py 2016-10-04 11:49:17.000000000 +0200
@@ -91,6 +91,8 @@
help="Included less-files (comma separated)")
aparse.add_argument('-V', '--verbose', action="store_true",
default=False, help="Verbose mode")
+ aparse.add_argument('-C', '--dont_create_dirs', action="store_true",
+ default=False, help="Creates directories when outputing files (lessc non-compatible)")
fgroup = aparse.add_argument_group('Formatting options')
fgroup.add_argument('-x', '--minify', action="store_true",
default=False, help="Minify output")
@@ -121,6 +123,7 @@
group.add_argument('-N', '--no-css', action="store_true",
default=False, help="No css output")
aparse.add_argument('target', help="less file or directory")
+ aparse.add_argument('output', nargs='?', help="output file path")
args = aparse.parse_args()
try:
#
@@ -180,6 +183,16 @@
p.scopemap()
if not args.no_css and p:
out = f.format(p)
- print(out)
+ if args.output:
+ if not args.dont_create_dirs and not os.path.exists(os.path.dirname(args.output)):
+ try:
+ os.makedirs(os.path.dirname(args.output))
+ except OSError as exc: # Guard against race condition
+ if exc.errno != errno.EEXIST:
+ raise
+ with open(args.output, "w") as f:
+ f.write(out)
+ else:
+ print(out)
except (KeyboardInterrupt, SystemExit, IOError):
sys.exit('\nAborting...')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy.egg-info/PKG-INFO new/lesscpy-0.12.0/lesscpy.egg-info/PKG-INFO
--- old/lesscpy-0.10.2/lesscpy.egg-info/PKG-INFO 2014-11-26 21:50:54.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy.egg-info/PKG-INFO 2016-10-04 13:18:23.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: lesscpy
-Version: 0.10.2
+Version: 0.12.0
Summary: Python LESS compiler
Home-page: https://github.com/lesscpy/lesscpy
Author: Jóhann T Maríusson
@@ -38,7 +38,7 @@
input and is considerably slower than the NodeJS compiler. The plan is to
utilize this to build in proper syntax checking and perhaps YUI compressing.
- This is an early version, so you are likly to find bugs.
+ This is an early version, so you are likely to find bugs.
For more information on LESS:
http://lesscss.org/ or https://github.com/cloudhead/less.js
@@ -63,7 +63,6 @@
- Color functions (lighten, darken, saturate, desaturate, spin, hue, mix,
saturation, lightness)
- Other functions (round, increment, decrement, format '%(', ...)
- - Keyframe blocks
Differences from less.js
@@ -82,7 +81,7 @@
Requirements
------------
- - Python 2.6, 2.7, or 3.3
+ - Python 2.6, 2.7, 3.3, 3.4, or 3.5
- ply (Python Lex-Yacc) (check requirements.txt)
@@ -189,5 +188,6 @@
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Pre-processors
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/lesscpy.egg-info/SOURCES.txt new/lesscpy-0.12.0/lesscpy.egg-info/SOURCES.txt
--- old/lesscpy-0.10.2/lesscpy.egg-info/SOURCES.txt 2014-11-26 21:50:54.000000000 +0100
+++ new/lesscpy-0.12.0/lesscpy.egg-info/SOURCES.txt 2016-10-04 13:18:23.000000000 +0200
@@ -33,7 +33,9 @@
lesscpy/plib/expression.py
lesscpy/plib/identifier.py
lesscpy/plib/import_.py
+lesscpy/plib/keyframe_selector.py
lesscpy/plib/mixin.py
+lesscpy/plib/negated_expression.py
lesscpy/plib/node.py
lesscpy/plib/property.py
lesscpy/plib/statement.py
@@ -50,7 +52,6 @@
test/test_color.pyc
test/test_expression.py
test/test_expression.pyc
-test/test_font_awesome.pyc
test/test_identifier.py
test/test_identifier.pyc
test/test_issues.py
@@ -58,10 +59,25 @@
test/test_less.py
test/test_less.pyc
test/test_lexer.py
+test/test_lexer.pyc
test/test_parser.py
+test/test_parser.pyc
test/test_pycompile.py
+test/test_pycompile.pyc
test/test_utility.py
test/test_utility.pyc
+test/__pycache__/__init__.cpython-35.pyc
+test/__pycache__/core.cpython-35.pyc
+test/__pycache__/test_bootstrap3.cpython-35.pyc
+test/__pycache__/test_color.cpython-35.pyc
+test/__pycache__/test_expression.cpython-35.pyc
+test/__pycache__/test_identifier.cpython-35.pyc
+test/__pycache__/test_issues.cpython-35.pyc
+test/__pycache__/test_less.cpython-35.pyc
+test/__pycache__/test_lexer.cpython-35.pyc
+test/__pycache__/test_parser.cpython-35.pyc
+test/__pycache__/test_pycompile.cpython-35.pyc
+test/__pycache__/test_utility.cpython-35.pyc
test/bootstrap3/css/bootstrap.css
test/bootstrap3/css/bootstrap.min.css
test/bootstrap3/css/theme.css
@@ -178,6 +194,7 @@
test/css/issues/issue4.css
test/css/issues/issue5.css
test/css/issues/issue6.css
+test/css/issues/issue67.css
test/less/argb.less
test/less/calls.less
test/less/colors.less
@@ -220,4 +237,5 @@
test/less/issues/issue31.less
test/less/issues/issue4.less
test/less/issues/issue5.less
-test/less/issues/issue6.less
\ No newline at end of file
+test/less/issues/issue6.less
+test/less/issues/issue67.less
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/setup.cfg new/lesscpy-0.12.0/setup.cfg
--- old/lesscpy-0.10.2/setup.cfg 2014-11-26 21:50:54.000000000 +0100
+++ new/lesscpy-0.12.0/setup.cfg 2016-10-04 13:18:23.000000000 +0200
@@ -2,7 +2,7 @@
universal = 1
[egg_info]
-tag_build =
tag_date = 0
+tag_build =
tag_svn_revision = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/setup.py new/lesscpy-0.12.0/setup.py
--- old/lesscpy-0.10.2/setup.py 2014-11-26 21:28:11.000000000 +0100
+++ new/lesscpy-0.12.0/setup.py 2016-10-04 11:49:17.000000000 +0200
@@ -53,6 +53,7 @@
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
'Topic :: Software Development :: Code Generators',
'Topic :: Software Development :: Pre-processors',
],
Binary files old/lesscpy-0.10.2/test/__init__.pyc and new/lesscpy-0.12.0/test/__init__.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/__init__.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/__init__.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/core.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/core.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_bootstrap3.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_bootstrap3.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_color.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_color.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_expression.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_expression.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_identifier.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_identifier.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_issues.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_issues.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_less.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_less.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_lexer.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_lexer.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_parser.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_parser.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_pycompile.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_pycompile.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/__pycache__/test_utility.cpython-35.pyc and new/lesscpy-0.12.0/test/__pycache__/test_utility.cpython-35.pyc differ
Binary files old/lesscpy-0.10.2/test/core.pyc and new/lesscpy-0.12.0/test/core.pyc differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/test/css/issues/issue67.css new/lesscpy-0.12.0/test/css/issues/issue67.css
--- old/lesscpy-0.10.2/test/css/issues/issue67.css 1970-01-01 01:00:00.000000000 +0100
+++ new/lesscpy-0.12.0/test/css/issues/issue67.css 2016-10-04 11:49:17.000000000 +0200
@@ -0,0 +1,3 @@
+.c {
+ left: 4;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/test/css/keyframes.css new/lesscpy-0.12.0/test/css/keyframes.css
--- old/lesscpy-0.10.2/test/css/keyframes.css 2014-02-02 18:34:18.000000000 +0100
+++ new/lesscpy-0.12.0/test/css/keyframes.css 2016-10-04 11:49:17.000000000 +0200
@@ -22,3 +22,25 @@
background-position: 40px 0;
}
}
+@keyframes using-percentages {
+ 0% {
+ top: 0;
+ }
+ 50% {
+ top: 1px;
+ }
+ 100% {
+ top: 2px;
+ }
+}
+@keyframes mixed-in {
+ from {
+ left: 0;
+ }
+ 50% {
+ left: 1px;
+ }
+ to {
+ left: 2px;
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/test/css/keyframes.min.css new/lesscpy-0.12.0/test/css/keyframes.min.css
--- old/lesscpy-0.10.2/test/css/keyframes.min.css 2014-02-02 18:34:18.000000000 +0100
+++ new/lesscpy-0.12.0/test/css/keyframes.min.css 2016-10-04 11:49:17.000000000 +0200
@@ -4,3 +4,9 @@
to{background-position:40px 0;}}
@keyframes progress-bar-stripes{from{background-position:0 0;}
to{background-position:40px 0;}}
+@keyframes using-percentages{0%{top:0;}
+50%{top:1px;}
+100%{top:2px;}}
+@keyframes mixed-in{from{left:0;}
+50%{left:1px;}
+to{left:2px;}}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/test/less/issues/issue67.less new/lesscpy-0.12.0/test/less/issues/issue67.less
--- old/lesscpy-0.10.2/test/less/issues/issue67.less 1970-01-01 01:00:00.000000000 +0100
+++ new/lesscpy-0.12.0/test/less/issues/issue67.less 2016-10-04 11:49:17.000000000 +0200
@@ -0,0 +1 @@
+.c { left: -(1 + 1) * -(1 + 1); }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/test/less/keyframes.less new/lesscpy-0.12.0/test/less/keyframes.less
--- old/lesscpy-0.10.2/test/less/keyframes.less 2014-02-02 18:34:18.000000000 +0100
+++ new/lesscpy-0.12.0/test/less/keyframes.less 2016-10-04 11:49:17.000000000 +0200
@@ -14,4 +14,21 @@
@keyframes progress-bar-stripes {
from { background-position: 0 0; }
to { background-position: 40px 0; }
-}
\ No newline at end of file
+}
+
+// using percentages
+@keyframes using-percentages {
+ 0% { top: 0; }
+ 50% { top: 1px; }
+ 100% { top: 2px; }
+}
+
+// in a mix-in
+.keyframe-mixin() {
+ from { left: 0; }
+ 50% { left: 1px; }
+ to { left: 2px; }
+}
+@keyframes mixed-in {
+ .keyframe-mixin();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/test/less/mixin-args-guards.less new/lesscpy-0.12.0/test/less/mixin-args-guards.less
--- old/lesscpy-0.10.2/test/less/mixin-args-guards.less 2014-02-02 18:34:18.000000000 +0100
+++ new/lesscpy-0.12.0/test/less/mixin-args-guards.less 2016-10-04 11:49:17.000000000 +0200
@@ -29,6 +29,8 @@
.mixin1(11);
.mixin1(-11);
}
+.eq (@a, @b) when (@a < @b) and (@b = @a) {
+}
.max (@a, @b) when (@a > @b) {
width: @a
}
Binary files old/lesscpy-0.10.2/test/test_bootstrap3.pyc and new/lesscpy-0.12.0/test/test_bootstrap3.pyc differ
Binary files old/lesscpy-0.10.2/test/test_color.pyc and new/lesscpy-0.12.0/test/test_color.pyc differ
Binary files old/lesscpy-0.10.2/test/test_expression.pyc and new/lesscpy-0.12.0/test/test_expression.pyc differ
Binary files old/lesscpy-0.10.2/test/test_font_awesome.pyc and new/lesscpy-0.12.0/test/test_font_awesome.pyc differ
Binary files old/lesscpy-0.10.2/test/test_identifier.pyc and new/lesscpy-0.12.0/test/test_identifier.pyc differ
Binary files old/lesscpy-0.10.2/test/test_issues.pyc and new/lesscpy-0.12.0/test/test_issues.pyc differ
Binary files old/lesscpy-0.10.2/test/test_less.pyc and new/lesscpy-0.12.0/test/test_less.pyc differ
Binary files old/lesscpy-0.10.2/test/test_lexer.pyc and new/lesscpy-0.12.0/test/test_lexer.pyc differ
Binary files old/lesscpy-0.10.2/test/test_parser.pyc and new/lesscpy-0.12.0/test/test_parser.pyc differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/test/test_pycompile.py new/lesscpy-0.12.0/test/test_pycompile.py
--- old/lesscpy-0.10.2/test/test_pycompile.py 2014-11-26 21:28:11.000000000 +0100
+++ new/lesscpy-0.12.0/test/test_pycompile.py 2016-10-04 11:49:17.000000000 +0200
@@ -14,7 +14,7 @@
Unit tests for compile
"""
- def test_compile(self):
+ def test_compile_from_stream(self):
"""
It can compile input from a file-like object
"""
@@ -22,6 +22,18 @@
output = compile(StringIO("a { border-width: 2px * 3; }"), minify=True)
self.assertEqual(output, "a{border-width:6px;}");
+ def test_compile_from_file(self):
+ """
+ It can compile input from a file object
+ """
+
+ import tempfile
+ in_file = tempfile.NamedTemporaryFile(mode='w+')
+ in_file.write("a { border-width: 2px * 3; }")
+ in_file.seek(0)
+ output = compile(in_file, minify=True)
+ self.assertEqual(output, "a{border-width:6px;}");
+
def test_raises_exception(self):
"""
Test if a syntax error raises an exception
@@ -30,4 +42,3 @@
fail_func = lambda: compile(StringIO("a }"), minify=True)
self.assertRaises(CompilationError, fail_func)
-
Binary files old/lesscpy-0.10.2/test/test_pycompile.pyc and new/lesscpy-0.12.0/test/test_pycompile.pyc differ
Binary files old/lesscpy-0.10.2/test/test_utility.pyc and new/lesscpy-0.12.0/test/test_utility.pyc differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lesscpy-0.10.2/tox.ini new/lesscpy-0.12.0/tox.ini
--- old/lesscpy-0.10.2/tox.ini 2014-02-02 18:34:18.000000000 +0100
+++ new/lesscpy-0.12.0/tox.ini 2016-10-04 13:09:38.000000000 +0200
@@ -1,5 +1,5 @@
[tox]
-envlist = py26,py27,py33,flake8
+envlist = py26,py27,py3,flake8
[testenv]
deps = -r{toxinidir}/test-requirements.txt
1
0
Hello community,
here is the log from the commit of package python-biplist for openSUSE:Factory checked in at 2017-09-04 12:31:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-biplist (Old)
and /work/SRC/openSUSE:Factory/.python-biplist.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-biplist"
Mon Sep 4 12:31:28 2017 rev:10 rq:519841 version:1.0.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-biplist/python-biplist.changes 2015-04-27 13:05:35.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.python-biplist.new/python-biplist.changes 2017-09-04 12:31:31.036051169 +0200
@@ -1,0 +2,21 @@
+Thu Aug 31 06:07:29 UTC 2017 - toddrme2178(a)gmail.com
+
+- Update to version 1.0.2
+ * Sort sets and dictionaries by key when writing.
+- Update to version 1.0.1
+ * Adding back in Python 2.6 support. This will be removed again in a future version.
+- Update to version 1.0.0
+ * This release changes the type of `Uid` from a subclass of `int` to a subclass of `object`.
+ * This change was made to address GitHub issue Ints are being turned into Uids and vice versa when both are present in a plist.
+ * This release also bumps the minimum supported Python versions to 2.7 and 3.4.
+- Update to version 0.9.1
+ * Fixes GitHub issue ERROR: testLargeDates (test_valid.TestValidPlistFile)
+ * Fixes Empty Data object converted as empty string
+ * Creates 1-byte strings when possible
+
+-------------------------------------------------------------------
+Thu Aug 24 13:33:20 UTC 2017 - jmatejek(a)suse.com
+
+- singlespec auto-conversion
+
+-------------------------------------------------------------------
@@ -38,0 +60 @@
+
Old:
----
biplist-0.9.tar.gz
New:
----
biplist-1.0.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-biplist.spec ++++++
--- /var/tmp/diff_new_pack.zuKIGu/_old 2017-09-04 12:31:32.275876850 +0200
+++ /var/tmp/diff_new_pack.zuKIGu/_new 2017-09-04 12:31:32.283875725 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-biplist
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -15,26 +15,31 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
+%ifarch x86_64
+%bcond_without test
+%else
+%bcond_with test
+%endif
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-biplist
-Version: 0.9
+Version: 1.0.2
Release: 0
-Url: https://bitbucket.org/wooster/biplist
Summary: A library for reading/writing binary plists
License: BSD-3-Clause
Group: Development/Languages/Python
-Source: http://pypi.python.org/packages/source/b/biplist/biplist-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-build
+Url: https://bitbucket.org/wooster/biplist
+Source: https://files.pythonhosted.org/packages/source/b/biplist/biplist-%{version}…
+BuildRequires: %{python_module devel}
+BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
-BuildRequires: python-coverage
-BuildRequires: python-devel >= 2.7
-BuildRequires: python-nose
-BuildRequires: python-setuptools
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
-BuildArch: noarch
+BuildRequires: python-rpm-macros
+%if %{with test}
+BuildRequires: %{python_module coverage}
+BuildRequires: %{python_module nose}
%endif
+BuildArch: noarch
+%python_subpackages
%description
biplist is a binary plist parser/generator for Python.
@@ -47,16 +52,18 @@
%setup -q -n biplist-%{version}
%build
-python setup.py build
+%python_build
%install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
-%fdupes %buildroot/%_prefix
+%python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%if %{with test}
%check
-python setup.py -q test
+%python_exec setup.py test
+%endif
-%files
+%files %{python_files}
%defattr(-,root,root,-)
%doc AUTHORS LICENSE README.md
%{python_sitelib}/*
++++++ biplist-0.9.tar.gz -> biplist-1.0.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/biplist-0.9/PKG-INFO new/biplist-1.0.2/PKG-INFO
--- old/biplist-0.9/PKG-INFO 2014-10-26 20:09:20.000000000 +0100
+++ new/biplist-1.0.2/PKG-INFO 2017-05-11 01:02:57.000000000 +0200
@@ -1,19 +1,19 @@
Metadata-Version: 1.1
Name: biplist
-Version: 0.9
+Version: 1.0.2
Summary: biplist is a library for reading/writing binary plists.
Home-page: https://bitbucket.org/wooster/biplist
Author: Andrew Wooster
Author-email: andrew(a)planetaryscale.com
License: BSD
-Download-URL: https://bitbucket.org/wooster/biplist/downloads/biplist-0.9.tar.gz
+Download-URL: https://bitbucket.org/wooster/biplist/downloads/biplist-1.0.2.tar.gz
Description: `biplist` is a binary plist parser/generator for Python.
Binary Property List (plist) files provide a faster and smaller serialization
format for property lists on OS X. This is a library for generating binary
plists which can be read by OS X, iOS, or other clients.
- This module requires Python 2.6 or higher or Python 3.2 or higher.
+ This module requires Python 2.6 or higher or Python 3.4 or higher.
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/biplist-0.9/biplist/__init__.py new/biplist-1.0.2/biplist/__init__.py
--- old/biplist-0.9/biplist/__init__.py 2014-10-26 20:03:11.000000000 +0100
+++ new/biplist-1.0.2/biplist/__init__.py 2017-05-11 00:53:56.000000000 +0200
@@ -44,13 +44,12 @@
print "Not a plist:", e
"""
-import sys
from collections import namedtuple
import datetime
import io
import math
import plistlib
-from struct import pack, unpack
+from struct import pack, unpack, unpack_from
from struct import error as struct_error
import sys
import time
@@ -79,23 +78,41 @@
# Apple uses Jan 1, 2001 as a base for all plist date/times.
apple_reference_date = datetime.datetime.utcfromtimestamp(978307200)
-class Uid(int):
+class Uid(object):
"""Wrapper around integers for representing UID values. This
is used in keyed archiving."""
+ integer = 0
+ def __init__(self, integer):
+ self.integer = integer
+
def __repr__(self):
- return "Uid(%d)" % self
+ return "Uid(%d)" % self.integer
+
+ def __eq__(self, other):
+ if isinstance(self, Uid) and isinstance(other, Uid):
+ return self.integer == other.integer
+ return False
+
+ def __cmp__(self, other):
+ return self.integer - other.integer
+
+ def __lt__(self, other):
+ return self.integer < other.integer
+
+ def __hash__(self):
+ return self.integer
+
+ def __int__(self):
+ return int(self.integer)
class Data(bytes):
- """Wrapper around str types for representing Data values."""
- pass
+ """Wrapper around bytes to distinguish Data values."""
class InvalidPlistException(Exception):
"""Raised when the plist is incorrectly formatted."""
- pass
class NotBinaryPlistException(Exception):
"""Raised when a binary plist was expected but not encountered."""
- pass
def readPlist(pathOrFile):
"""Raises NotBinaryPlistException, InvalidPlistException"""
@@ -379,7 +396,7 @@
def readAsciiString(self, length):
result = unpack("!%ds" % length, self.contents[self.currentOffset:self.currentOffset+length])[0]
self.currentOffset += length
- return result
+ return str(result.decode('ascii'))
def readUnicode(self, length):
actual_length = length*2
@@ -426,7 +443,9 @@
result = int.from_bytes(data, 'big')
else:
for byte in data:
- result = (result << 8) | unpack('>B', byte)[0]
+ if not isinstance(byte, int): # Python3.0-3.1.x return ints, 2.x return str
+ byte = unpack_from('>B', byte)[0]
+ result = (result << 8) | byte
else:
raise InvalidPlistException("Encountered integer longer than 16 bytes.")
return result
@@ -456,6 +475,51 @@
def __repr__(self):
return "<FloatWrapper: %s>" % self.value
+class StringWrapper(object):
+ __instances = {}
+
+ encodedValue = None
+ encoding = None
+
+ def __new__(cls, value):
+ '''Ensure we only have a only one instance for any string,
+ and that we encode ascii as 1-byte-per character when possible'''
+
+ encodedValue = None
+
+ for encoding in ('ascii', 'utf_16_be'):
+ try:
+ encodedValue = value.encode(encoding)
+ except: pass
+ if encodedValue is not None:
+ if encodedValue not in cls.__instances:
+ cls.__instances[encodedValue] = super(StringWrapper, cls).__new__(cls)
+ cls.__instances[encodedValue].encodedValue = encodedValue
+ cls.__instances[encodedValue].encoding = encoding
+ return cls.__instances[encodedValue]
+
+ raise ValueError('Unable to get ascii or utf_16_be encoding for %s' % repr(value))
+
+ def __len__(self):
+ '''Return roughly the number of characters in this string (half the byte length)'''
+ if self.encoding == 'ascii':
+ return len(self.encodedValue)
+ else:
+ return len(self.encodedValue)//2
+
+ def __lt__(self, other):
+ return self.encodedValue < other.encodedValue
+
+ @property
+ def encodingMarker(self):
+ if self.encoding == 'ascii':
+ return 0b0101
+ else:
+ return 0b0110
+
+ def __repr__(self):
+ return '<StringWrapper (%s): %s>' % (self.encoding, self.encodedValue)
+
class PlistWriter(object):
header = b'bplist00bybiplist1.0'
file = None
@@ -507,10 +571,9 @@
"""
output = self.header
wrapped_root = self.wrapRoot(root)
- should_reference_root = True#not isinstance(wrapped_root, HashableWrapper)
- self.computeOffsets(wrapped_root, asReference=should_reference_root, isRoot=True)
+ self.computeOffsets(wrapped_root, asReference=True, isRoot=True)
self.trailer = self.trailer._replace(**{'objectRefSize':self.intSize(len(self.computedUniques))})
- (_, output) = self.writeObjectReference(wrapped_root, output)
+ self.writeObjectReference(wrapped_root, output)
output = self.writeObject(wrapped_root, output, setReferencePosition=True)
# output size at this point is an upper bound on how big the
@@ -552,6 +615,10 @@
elif isinstance(root, tuple):
n = tuple([self.wrapRoot(value) for value in root])
return HashableWrapper(n)
+ elif isinstance(root, (str, unicode)) and not isinstance(root, Data):
+ return StringWrapper(root)
+ elif isinstance(root, bytes):
+ return Data(root)
else:
return root
@@ -564,7 +631,7 @@
raise InvalidPlistException('Dictionary keys cannot be null in plists.')
elif isinstance(key, Data):
raise InvalidPlistException('Data cannot be dictionary keys in plists.')
- elif not isinstance(key, (bytes, unicode)):
+ elif not isinstance(key, StringWrapper):
raise InvalidPlistException('Keys must be strings.')
def proc_size(size):
@@ -584,7 +651,7 @@
elif isinstance(obj, BoolWrapper):
self.incrementByteCount('boolBytes')
elif isinstance(obj, Uid):
- size = self.intSize(obj)
+ size = self.intSize(obj.integer)
self.incrementByteCount('uidBytes', incr=1+size)
elif isinstance(obj, (int, long)):
size = self.intSize(obj)
@@ -597,7 +664,7 @@
elif isinstance(obj, Data):
size = proc_size(len(obj))
self.incrementByteCount('dataBytes', incr=1+size)
- elif isinstance(obj, (unicode, bytes)):
+ elif isinstance(obj, StringWrapper):
size = proc_size(len(obj))
self.incrementByteCount('stringBytes', incr=1+size)
elif isinstance(obj, HashableWrapper):
@@ -621,7 +688,7 @@
self.computeOffsets(key, asReference=True)
self.computeOffsets(value, asReference=True)
else:
- raise InvalidPlistException("Unknown object type.")
+ raise InvalidPlistException("Unknown object type: %s (%s)" % (type(obj).__name__, repr(obj)))
def writeObjectReference(self, obj, output):
"""Tries to write an object reference, adding it to the references
@@ -653,9 +720,10 @@
result += pack('!B', (format << 4) | length)
return result
- if isinstance(obj, (str, unicode)) and obj == unicodeEmpty:
- # The Apple Plist decoder can't decode a zero length Unicode string.
- obj = b''
+ def timedelta_total_seconds(td):
+ # Shim for Python 2.6 compatibility, which doesn't have total_seconds.
+ # Make one argument a float to ensure the right calculation.
+ return (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10.0**6) / 10.0**6
if setReferencePosition:
self.referencePositions[obj] = len(output)
@@ -668,9 +736,9 @@
else:
output += pack('!B', 0b00001001)
elif isinstance(obj, Uid):
- size = self.intSize(obj)
+ size = self.intSize(obj.integer)
output += pack('!B', (0b1000 << 4) | size - 1)
- output += self.binaryInt(obj)
+ output += self.binaryInt(obj.integer)
elif isinstance(obj, (int, long)):
byteSize = self.intSize(obj)
root = math.log(byteSize, 2)
@@ -681,16 +749,18 @@
output += pack('!B', (0b0010 << 4) | 3)
output += self.binaryReal(obj)
elif isinstance(obj, datetime.datetime):
- timestamp = (obj - apple_reference_date).total_seconds()
+ try:
+ timestamp = (obj - apple_reference_date).total_seconds()
+ except AttributeError:
+ timestamp = timedelta_total_seconds(obj - apple_reference_date)
output += pack('!B', 0b00110011)
output += pack('!d', float(timestamp))
elif isinstance(obj, Data):
output += proc_variable_length(0b0100, len(obj))
output += obj
- elif isinstance(obj, unicode):
- byteData = obj.encode('utf_16_be')
- output += proc_variable_length(0b0110, len(byteData)//2)
- output += byteData
+ elif isinstance(obj, StringWrapper):
+ output += proc_variable_length(obj.encodingMarker, len(obj))
+ output += obj.encodedValue
elif isinstance(obj, bytes):
output += proc_variable_length(0b0101, len(obj))
output += obj
@@ -703,7 +773,7 @@
output += proc_variable_length(0b1010, len(obj))
objectsToWrite = []
- for objRef in obj:
+ for objRef in sorted(obj) if isinstance(obj, set) else obj:
(isNew, output) = self.writeObjectReference(objRef, output)
if isNew:
objectsToWrite.append(objRef)
@@ -714,7 +784,7 @@
keys = []
values = []
objectsToWrite = []
- for key, value in iteritems(obj):
+ for key, value in sorted(iteritems(obj)):
keys.append(key)
values.append(value)
for key in keys:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/biplist-0.9/biplist.egg-info/PKG-INFO new/biplist-1.0.2/biplist.egg-info/PKG-INFO
--- old/biplist-0.9/biplist.egg-info/PKG-INFO 2014-10-26 20:09:20.000000000 +0100
+++ new/biplist-1.0.2/biplist.egg-info/PKG-INFO 2017-05-11 01:02:57.000000000 +0200
@@ -1,19 +1,19 @@
Metadata-Version: 1.1
Name: biplist
-Version: 0.9
+Version: 1.0.2
Summary: biplist is a library for reading/writing binary plists.
Home-page: https://bitbucket.org/wooster/biplist
Author: Andrew Wooster
Author-email: andrew(a)planetaryscale.com
License: BSD
-Download-URL: https://bitbucket.org/wooster/biplist/downloads/biplist-0.9.tar.gz
+Download-URL: https://bitbucket.org/wooster/biplist/downloads/biplist-1.0.2.tar.gz
Description: `biplist` is a binary plist parser/generator for Python.
Binary Property List (plist) files provide a faster and smaller serialization
format for property lists on OS X. This is a library for generating binary
plists which can be read by OS X, iOS, or other clients.
- This module requires Python 2.6 or higher or Python 3.2 or higher.
+ This module requires Python 2.6 or higher or Python 3.4 or higher.
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/biplist-0.9/setup.py new/biplist-1.0.2/setup.py
--- old/biplist-0.9/setup.py 2014-10-26 20:04:50.000000000 +0100
+++ new/biplist-1.0.2/setup.py 2017-05-11 00:55:28.000000000 +0200
@@ -12,21 +12,21 @@
major, minor, micro, releaselevel, serial = sys.version_info
-if major <= 1 or (major == 2 and minor < 6) or (major == 3 and minor < 2):
+if major <= 1 or (major == 2 and minor < 6) or (major == 3 and minor < 4):
# N.B.: Haven't tested with older py3k versions.
- print('This module supports Python 2 >= 2.6 and Python 3 >= 3.2.')
+ print('This module supports Python 2 >= 2.6 and Python 3 >= 3.4.')
sys.exit(1)
author = 'Andrew Wooster'
email = 'andrew(a)planetaryscale.com'
-version = '0.9'
+version = '1.0.2'
desc = 'biplist is a library for reading/writing binary plists.'
setup(
name = 'biplist',
version = version,
url = 'https://bitbucket.org/wooster/biplist',
- download_url = 'https://bitbucket.org/wooster/biplist/downloads/biplist-0.9.tar.gz',
+ download_url = 'https://bitbucket.org/wooster/biplist/downloads/biplist-%s.tar.gz' % version,
license = 'BSD',
description = desc,
long_description =
@@ -36,7 +36,7 @@
format for property lists on OS X. This is a library for generating binary
plists which can be read by OS X, iOS, or other clients.
-This module requires Python 2.6 or higher or Python 3.2 or higher.""",
+This module requires Python 2.6 or higher or Python 3.4 or higher.""",
author = author,
author_email = email,
packages = find_packages(),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/biplist-0.9/tests/test_valid.py new/biplist-1.0.2/tests/test_valid.py
--- old/biplist-0.9/tests/test_valid.py 2014-10-26 20:03:33.000000000 +0100
+++ new/biplist-1.0.2/tests/test_valid.py 2016-06-18 01:44:56.000000000 +0200
@@ -19,19 +19,19 @@
def validateSimpleBinaryRoot(self, root):
self.assertTrue(type(root) == dict, "Root should be dictionary.")
- self.assertTrue(type(root[b'dateItem']) == datetime.datetime, "date should be datetime")
- us = root[b'dateItem'].microsecond
+ self.assertTrue(type(root['dateItem']) == datetime.datetime, "date should be datetime")
+ us = root['dateItem'].microsecond
if us == 385448:
# Python 3 doesn't round microseconds to the nearest value.
- self.assertEqual(root[b'dateItem'], datetime.datetime(2010, 8, 19, 22, 27, 30, 385448), "dates not equal" )
+ self.assertEqual(root['dateItem'], datetime.datetime(2010, 8, 19, 22, 27, 30, 385448), "dates not equal" )
else:
- self.assertEqual(root[b'dateItem'], datetime.datetime(2010, 8, 19, 22, 27, 30, 385449), "dates not equal" )
- self.assertEqual(root[b'numberItem'], -10000000000000000, "number not of expected value")
- self.assertEqual(root[b'unicodeItem'], toUnicode('abc\u212cdef\u2133'))
- self.assertEqual(root[b'stringItem'], b'Hi there')
- self.assertEqual(root[b'realItem'], 0.47)
- self.assertEqual(root[b'boolItem'], True)
- self.assertEqual(root[b'arrayItem'], [b'item0'])
+ self.assertEqual(root['dateItem'], datetime.datetime(2010, 8, 19, 22, 27, 30, 385449), "dates not equal" )
+ self.assertEqual(root['numberItem'], -10000000000000000, "number not of expected value")
+ self.assertEqual(root['unicodeItem'], toUnicode('abc\u212cdef\u2133'))
+ self.assertEqual(root['stringItem'], 'Hi there')
+ self.assertEqual(root['realItem'], 0.47)
+ self.assertEqual(root['boolItem'], True)
+ self.assertEqual(root['arrayItem'], ['item0'])
def testFileRead(self):
try:
@@ -55,17 +55,17 @@
# 0b0101 (ASCII string), so the value being asserted against
# appears to be what is wrong.
result = readPlist(data_path('unicode_empty.plist'))
- self.assertEqual(result, b'')
+ self.assertEqual(result, '')
def testSmallReal(self):
result = readPlist(data_path('small_real.plist'))
- self.assertEqual(result, {b'4 byte real':0.5})
+ self.assertEqual(result, {'4 byte real':0.5})
def testLargeIntegers(self):
result = readPlist(data_path('large_int_limits.plist'))
- self.assertEqual(result[b'Max 8 Byte Unsigned Integer'], 18446744073709551615)
- self.assertEqual(result[b'Min 8 Byte Signed Integer'], -9223372036854775808)
- self.assertEqual(result[b'Max 8 Byte Signed Integer'], 9223372036854775807)
+ self.assertEqual(result['Max 8 Byte Unsigned Integer'], 18446744073709551615)
+ self.assertEqual(result['Min 8 Byte Signed Integer'], -9223372036854775808)
+ self.assertEqual(result['Max 8 Byte Signed Integer'], 9223372036854775807)
def testLargeDates(self):
result = readPlist(data_path("BFPersistentEventInfo.plist"))
@@ -86,15 +86,31 @@
...
"""
result = readPlist(data_path('nskeyedarchiver_example.plist'))
- self.assertEqual(result, {b'$version': 100000,
- b'$objects':
- [b'$null',
- {b'$class': Uid(3), b'somekey': Uid(2)},
- b'object value as string',
- {b'$classes': [b'Archived', b'NSObject'], b'$classname': b'Archived'}
- ],
- b'$top': {b'root': Uid(1)}, b'$archiver': b'NSKeyedArchiver'})
+ self.assertEqual(result, {
+ '$version': 100000,
+ '$objects':
+ [
+ '$null',
+ {'$class':Uid(3), 'somekey':Uid(2)},
+ 'object value as string',
+ {'$classes':['Archived', 'NSObject'], '$classname':'Archived'}
+ ],
+ '$top': {'root':Uid(1)},
+ '$archiver':'NSKeyedArchiver'
+ })
self.assertEqual("Uid(1)", repr(Uid(1)))
+ def testUidComparisons(self):
+ self.assertTrue(Uid(-2) < Uid(-1))
+ self.assertTrue(Uid(-1) < Uid(0))
+ self.assertTrue(Uid(1) > Uid(0))
+ self.assertTrue(Uid(1) > Uid(-2))
+ self.assertTrue(Uid(-1) == Uid(-1))
+ self.assertTrue(Uid(0) == Uid(0))
+ self.assertTrue(Uid(1) == Uid(1))
+
+ self.assertFalse(1 == Uid(1))
+ self.assertFalse(Uid(0) == 0)
+
if __name__ == '__main__':
unittest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/biplist-0.9/tests/test_write.py new/biplist-1.0.2/tests/test_write.py
--- old/biplist-0.9/tests/test_write.py 2014-10-26 20:03:11.000000000 +0100
+++ new/biplist-1.0.2/tests/test_write.py 2016-06-18 01:44:56.000000000 +0200
@@ -1,39 +1,82 @@
+#!/usr/local/env python
+# -*- coding: utf-8 -*-
+
+import datetime, io, os, subprocess, sys, tempfile, unittest
+
from biplist import *
from biplist import PlistWriter
-import datetime
-import io
-import os
-#from cStringIO import StringIO
-import subprocess
-import tempfile
from test_utils import *
-import unittest
try:
unicode
+ unicodeStr = lambda x: x.decode('utf-8')
+ toUnicode = lambda x: x.decode('unicode-escape')
except NameError:
unicode = str
+ unicodeStr = lambda x: x
+ toUnicode = lambda x: x
+try:
+ xrange
+except NameError:
+ xrange = range
class TestWritePlist(unittest.TestCase):
- def setUp(self):
- pass
- def roundTrip(self, root, xml=False, expected=None):
- # 'expected' is more fallout from the
- # don't-write-empty-unicode-strings issue.
- plist = writePlistToString(root, binary=(not xml))
+ def roundTrip(self, case, xml=False, expected=None, reprTest=True):
+ # reprTest may fail randomly if True and the values being encoded include a dictionary with more
+ # than one key.
+
+ # convert to plist string
+ plist = writePlistToString(case, binary=(not xml))
self.assertTrue(len(plist) > 0)
+
+ # confirm that lint is happy with the result
+ self.lintPlist(plist)
+
+ # convert back
readResult = readPlistFromString(plist)
- self.assertEqual(readResult, (expected if expected is not None else root))
- self.lintPlist(plist)
-
- def lintPlist(self, plistString):
- if os.path.exists('/usr/bin/plutil'):
- f = tempfile.NamedTemporaryFile()
- f.write(plistString)
- f.flush()
- name = f.name
- (status, output) = run_command(['/usr/bin/plutil', '-lint', name])
+
+ # test equality
+ if reprTest is True:
+ self.assertEqual(repr(case if expected is None else expected), repr(readResult))
+ else:
+ self.assertEqual((case if expected is None else expected), readResult)
+
+ # write to file
+ plistFile = tempfile.NamedTemporaryFile(mode='wb+', suffix='.plist')
+ writePlist(case, plistFile, binary=(xml is False))
+ plistFile.seek(0)
+
+ # confirm that lint is happy with the result
+ self.lintPlist(plistFile)
+
+ # read back from file
+ fileResult = readPlist(plistFile)
+
+ # test equality
+ if reprTest is True:
+ self.assertEqual(repr(case if expected is None else expected), repr(fileResult))
+ else:
+ self.assertEqual((case if expected is None else expected), fileResult)
+
+ def lintPlist(self, plist):
+ if os.access('/usr/bin/plutil', os.X_OK):
+ plistFile = None
+ plistFilePath = None
+
+ if hasattr(plist, 'name'):
+ plistFilePath = plist.name
+ else:
+ if hasattr(plist, 'read'):
+ plistFile = tempfile.NamedTemporaryFile('w%s' % ('b' if 'b' in plist.mode else ''))
+ plistFile.write(plist.read())
+ else:
+ plistFile = tempfile.NamedTemporaryFile('w%s' % ('b' if isinstance(plist, bytes) else ''))
+ plistFile.write(plist)
+ plistFilePath = plistFile.name
+ plistFile.flush()
+
+ status, output = run_command(['/usr/bin/plutil', '-lint', plistFilePath])
if status != 0:
self.fail("plutil verification failed (status %d): %s" % (status, output))
@@ -58,36 +101,32 @@
self.roundTrip(False)
def testDuplicate(self):
- l = ["foo" for i in range(0, 100)]
+ l = ["foo" for i in xrange(0, 100)]
self.roundTrip(l)
def testListRoot(self):
self.roundTrip([1, 2, 3])
def testDictRoot(self):
- self.roundTrip({'a':1, 'B':'d'})
+ self.roundTrip({'a':1, 'B':'d'}, reprTest=False)
def mixedNumericTypesHelper(self, cases):
result = readPlistFromString(writePlistToString(cases))
- for i in range(0, len(cases)):
+ for i in xrange(0, len(cases)):
self.assertTrue(cases[i] == result[i])
self.assertEqual(type(cases[i]), type(result[i]), "Type mismatch on %d: %s != %s" % (i, repr(cases[i]), repr(result[i])))
- def reprChecker(self, case):
- result = readPlistFromString(writePlistToString(case))
- self.assertEqual(repr(case), repr(result))
-
def testBoolsAndIntegersMixed(self):
self.mixedNumericTypesHelper([0, 1, True, False, None])
self.mixedNumericTypesHelper([False, True, 0, 1, None])
- self.reprChecker({unicode('1'):[True, False, 1, 0], unicode('0'):[1, 2, 0, {unicode('2'):[1, 0, False]}]})
- self.reprChecker([1, 1, 1, 1, 1, True, True, True, True])
+ self.roundTrip({'1':[True, False, 1, 0], '0':[1, 2, 0, {'2':[1, 0, False]}]}, reprTest=False)
+ self.roundTrip([1, 1, 1, 1, 1, True, True, True, True])
def testFloatsAndIntegersMixed(self):
self.mixedNumericTypesHelper([0, 1, 1.0, 0.0, None])
self.mixedNumericTypesHelper([0.0, 1.0, 0, 1, None])
- self.reprChecker({unicode('1'):[1.0, 0.0, 1, 0], unicode('0'):[1, 2, 0, {unicode('2'):[1, 0, 0.0]}]})
- self.reprChecker([1, 1, 1, 1, 1, 1.0, 1.0, 1.0, 1.0])
+ self.roundTrip({'1':[1.0, 0.0, 1, 0], '0':[1, 2, 0, {'2':[1, 0, 0.0]}]}, reprTest=False)
+ self.roundTrip([1, 1, 1, 1, 1, 1.0, 1.0, 1.0, 1.0])
def testSetRoot(self):
self.roundTrip(set((1, 2, 3)))
@@ -112,36 +151,102 @@
self.lintPlist(writePlistToString(root))
self.roundTrip(root)
- def testString(self):
+ def testBytes(self):
self.roundTrip(b'0')
self.roundTrip(b'')
- self.roundTrip({b'a':b''})
+
+ self.roundTrip([b'0'])
+ self.roundTrip([b''])
+
+ self.roundTrip({'a': b'0'})
+ self.roundTrip({'a': b''})
- def testLargeDict(self):
- d = {}
- for i in range(0, 1000):
- d['%d' % i] = '%d' % i
- self.roundTrip(d)
+ def testString(self):
+ self.roundTrip('')
+ self.roundTrip('a')
+ self.roundTrip('1')
+
+ self.roundTrip([''])
+ self.roundTrip(['a'])
+ self.roundTrip(['1'])
+
+ self.roundTrip({'a':''})
+ self.roundTrip({'a':'a'})
+ self.roundTrip({'1':'a'})
+ self.roundTrip({'a':'a'})
+ self.roundTrip({'a':'1'})
+
+ def testUnicode(self):
+ # defaulting to 1 byte strings
+ if str != unicode:
+ self.roundTrip(unicodeStr(r''), expected='')
+ self.roundTrip(unicodeStr(r'a'), expected='a')
+
+ self.roundTrip([unicodeStr(r'a')], expected=['a'])
+
+ self.roundTrip({'a':unicodeStr(r'a')}, expected={'a':'a'})
+ self.roundTrip({unicodeStr(r'a'):'a'}, expected={'a':'a'})
+ self.roundTrip({unicodeStr(r''):unicodeStr(r'')}, expected={'':''})
+
+ # TODO: need a 4-byte unicode character
+ self.roundTrip(unicodeStr(r'ü'))
+ self.roundTrip([unicodeStr(r'ü')])
+ self.roundTrip({'a':unicodeStr(r'ü')})
+ self.roundTrip({unicodeStr(r'ü'):'a'})
+
+ self.roundTrip(toUnicode('\u00b6'))
+ self.roundTrip([toUnicode('\u00b6')])
+ self.roundTrip({toUnicode('\u00b6'):toUnicode('\u00b6')})
+
+ self.roundTrip(toUnicode('\u1D161'))
+ self.roundTrip([toUnicode('\u1D161')])
+ self.roundTrip({toUnicode('\u1D161'):toUnicode('\u1D161')})
+
+ # Smiley face emoji
+ self.roundTrip(toUnicode('\U0001f604'))
+ self.roundTrip([toUnicode('\U0001f604'), toUnicode('\U0001f604')])
+ self.roundTrip({toUnicode('\U0001f604'):toUnicode('\U0001f604')})
+
+ def testNone(self):
+ self.roundTrip(None)
+ self.roundTrip({'1':None})
+ self.roundTrip([None, None, None])
+
def testBools(self):
+ self.roundTrip(True)
+ self.roundTrip(False)
+
self.roundTrip([True, False])
+
+ self.roundTrip({'a':True, 'b':False}, reprTest=False)
def testUniques(self):
root = {'hi':'there', 'halloo':'there'}
- self.roundTrip(root)
+ self.roundTrip(root, reprTest=False)
+
+ def testAllEmpties(self):
+ '''Primarily testint that an empty unicode and bytes are not mixed up'''
+ self.roundTrip([unicodeStr(''), '', b'', [], {}], expected=['', '', b'', [], {}])
+ def testLargeDict(self):
+ d = dict((str(x), str(x)) for x in xrange(0, 1000))
+ self.roundTrip(d, reprTest=False)
+
def testWriteToFile(self):
for is_binary in [True, False]:
- path = '/var/tmp/test.plist'
- writePlist([1, 2, 3], path, binary=is_binary)
- self.assertTrue(os.path.exists(path))
- with open(path, 'rb') as f:
- self.lintPlist(f.read())
-
- def testNone(self):
- self.roundTrip(None)
- self.roundTrip({'1':None})
- self.roundTrip([None, None, None])
+ with tempfile.NamedTemporaryFile(mode='w%s' % ('b' if is_binary else ''), suffix='.plist') as plistFile:
+ # clear out the created file
+ os.unlink(plistFile.name)
+ self.assertFalse(os.path.exists(plistFile.name))
+
+ # write to disk
+ writePlist([1, 2, 3], plistFile.name, binary=is_binary)
+ self.assertTrue(os.path.exists(plistFile.name))
+
+ with open(plistFile.name, 'r%s' % ('b' if is_binary else '')) as f:
+ fileContents = f.read()
+ self.lintPlist(fileContents)
def testBadKeys(self):
try:
@@ -169,7 +274,7 @@
-pow(2, 15), pow(2, 15) - 1,
-pow(2, 31), pow(2, 31) - 1,
-pow(2, 63), pow(2, 64) - 1]
- self.roundTrip(edges)
+ self.roundTrip(edges, reprTest=False)
ioBytes = io.BytesIO()
writer = PlistWriter(ioBytes)
@@ -185,7 +290,7 @@
self.assertEqual(bytelen, got, "Byte size is wrong. Expected %d, got %d" % (bytelen, got))
bytes_lists = [list(x) for x in bytes]
- self.roundTrip(bytes_lists)
+ self.roundTrip(bytes_lists, reprTest=False)
try:
self.roundTrip([0x10000000000000000, pow(2, 64)])
@@ -193,17 +298,23 @@
except InvalidPlistException as e:
pass
- def testWriteData(self):
- self.roundTrip(Data(b"woohoo"))
-
- def testUnicode(self):
- unicodeRoot = unicode("Mirror's Edge\u2122 for iPad")
- writePlist(unicodeRoot, "/tmp/odd.plist")
+ def testUnicode2(self):
+ unicodeRoot = toUnicode("Mirror's Edge\u2122 for iPad")
self.roundTrip(unicodeRoot)
- unicodeStrings = [unicode("Mirror's Edge\u2122 for iPad"), unicode('Weightbot \u2014 Track your Weight in Style')]
+ unicodeStrings = [toUnicode("Mirror's Edge\u2122 for iPad"), toUnicode('Weightbot \u2014 Track your Weight in Style')]
self.roundTrip(unicodeStrings)
- self.roundTrip({unicode(""):unicode("")}, expected={b'':b''})
- self.roundTrip(unicode(""), expected=b'')
+ self.roundTrip({toUnicode(""):toUnicode("")}, expected={'':''})
+ self.roundTrip(toUnicode(""), expected='')
+
+ def testWriteData(self):
+ self.roundTrip(Data(b"woohoo"))
+
+ def testEmptyData(self):
+ data = Data(b'')
+ binplist = writePlistToString(data)
+ plist = readPlistFromString(binplist)
+ self.assertEqual(plist, data)
+ self.assertEqual(type(plist), type(data))
def testUidWrite(self):
self.roundTrip({'$version': 100000,
@@ -213,7 +324,14 @@
'object value as string',
{'$classes': ['Archived', 'NSObject'], '$classname': 'Archived'}
],
- '$top': {'root': Uid(1)}, '$archiver': 'NSKeyedArchiver'})
+ '$top': {'root': Uid(1)}, '$archiver': 'NSKeyedArchiver'}, reprTest=False)
+
+ def testUidRoundTrip(self):
+ # Per https://github.com/wooster/biplist/issues/9
+ self.roundTrip(Uid(1))
+ self.roundTrip([Uid(1), 1])
+ self.roundTrip([1, Uid(1)])
+ self.roundTrip([Uid(1), Uid(1)])
if __name__ == '__main__':
unittest.main()
1
0