[DRE-commits] [ruby-gemojione] 05/05: Make tests run

Balasankar C balasankarc-guest at moszumanska.debian.org
Thu Dec 3 15:44:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

balasankarc-guest pushed a commit to branch master
in repository ruby-gemojione.

commit 559de521648ecdd1ab645b2127189357e3b19983
Author: Balasankar C <balasankarc at autistici.org>
Date:   Thu Dec 3 21:08:09 2015 +0530

    Make tests run
---
 debian/patches/change_source_directory.patch | 35 ++++++++++++++++++++++++++++
 debian/patches/remove-bundler.patch          | 13 +++++++++++
 debian/patches/series                        |  2 ++
 3 files changed, 50 insertions(+)

diff --git a/debian/patches/change_source_directory.patch b/debian/patches/change_source_directory.patch
new file mode 100644
index 0000000..eef3c8b
--- /dev/null
+++ b/debian/patches/change_source_directory.patch
@@ -0,0 +1,35 @@
+Description: Change path to Debian specific one
+ Change the relative path used in lib and installation task file to a Debian
+ specific one where the images will be shipped by this package. 
+Author: Balasankar C <balasankarc at autistici.org>
+Last-Update: 2015-12-03
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/lib/gemojione/tasks/install.rake
++++ b/lib/gemojione/tasks/install.rake
+@@ -2,7 +2,7 @@
+   desc "Install Emoji Image Assets"
+   task :install_assets do
+     target_dir = ENV['TARGET'] ||= File.join(Rails.root, 'app/assets/images/emoji')
+-    source_dir = File.absolute_path(File.dirname(__FILE__) + '/../../../assets/images')
++    source_dir = File.absolute_path('/usr/share/ruby-gemojione/assets/images')
+ 
+     puts "===================================================================="
+     puts "= emoji image assets install"
+--- a/lib/gemojione/index.rb
++++ b/lib/gemojione/index.rb
+@@ -2,7 +2,13 @@
+   class Index
+     def initialize(emoji_list=nil)
+       emoji_list ||= begin
+-        emoji_json = File.read(File.absolute_path(File.dirname(__FILE__) + '/../../config/index.json'))
++        if File.exist?(File.absolute_path('/usr/share/ruby-gemojione/config/index.json'))
++            # For usage after installation
++            emoji_json = File.read(File.absolute_path('/usr/share/ruby-gemojione/config/index.json'))
++        else
++            # For running tests in Debian
++            emoji_json = File.read(File.absolute_path(File.dirname(__FILE__) + '../../../../../share/ruby-gemojione/config/index.json'))
++        end
+         JSON.parse(emoji_json)
+       end
+ 
diff --git a/debian/patches/remove-bundler.patch b/debian/patches/remove-bundler.patch
new file mode 100644
index 0000000..c217def
--- /dev/null
+++ b/debian/patches/remove-bundler.patch
@@ -0,0 +1,13 @@
+Description: Remove bundler while running tests
+Author: Balasankar C <balasankarc at autistici.org>
+Last-Update: 2015-12-03
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/test/test_helper.rb
++++ b/test/test_helper.rb
+@@ -1,5 +1,4 @@
+ require 'rubygems'
+-require 'bundler/setup'
+ 
+ require 'gemojione'
+ 
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..91798b4
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+change_source_directory.patch
+remove-bundler.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-gemojione.git



More information about the Pkg-ruby-extras-commits mailing list