[Git][noosfero/noosfero][master] Basic support for jruby

Bráulio Bhavamitra gitlab at mg.gitlab.com
Fri Mar 17 18:28:56 BRT 2017


Bráulio Bhavamitra pushed to branch master at Noosfero / noosfero


Commits:
3601bf5b by Braulio Bhavamitra at 2017-03-17T18:28:39-03:00
Basic support for jruby

- - - - -


4 changed files:

- Gemfile
- app/models/uploaded_file.rb
- config/application.rb
- config/puma.rb


Changes:

=====================================
Gemfile
=====================================
--- a/Gemfile
+++ b/Gemfile
@@ -3,7 +3,10 @@ source "https://rubygems.org"
 platform :ruby do
   gem 'pg',                     '~> 0.17'
   gem 'rmagick',                '~> 2.13'
+  gem 'RedCloth',               '~> 4.2'
+  gem 'unicorn',                '~> 4.8'
 end
+
 platform :jruby do
   gem 'activerecord-jdbcpostgresql-adapter'
   gem 'rmagick4j'
@@ -13,10 +16,8 @@ gem 'rails',                    '~> 4.2.4'
 gem 'fast_gettext',             '~> 0.9'
 gem 'acts-as-taggable-on',      '~> 3.5'
 gem 'rails_autolink',           '~> 1.1.5'
-gem 'RedCloth',                 '~> 4.2'
 gem 'ruby-feedparser',          '~> 0.7'
 gem 'daemons',                  '~> 1.1'
-gem 'unicorn',                  '~> 4.8'
 gem 'nokogiri',                 '~> 1.6.0'
 gem 'will_paginate',            '~> 3.0.7'
 gem 'pothoven-attachment_fu',   '~> 3.2.16'


=====================================
app/models/uploaded_file.rb
=====================================
--- a/app/models/uploaded_file.rb
+++ b/app/models/uploaded_file.rb
@@ -3,7 +3,7 @@
 # Limitation: only file metadata are versioned. Only the latest version
 # of the file itself is kept. (FIXME?)
 
-require 'sdbm'
+require 'sdbm' unless RUBY_ENGINE == 'jruby'
 
 class UploadedFile < Article
 
@@ -30,7 +30,7 @@ class UploadedFile < Article
       end
       dbm.close
     end
-  end
+  end unless RUBY_ENGINE == 'jruby'
 
   track_actions :upload_image, :after_create, :keep_params => ["view_url", "thumbnail_path", "parent.url", "parent.name"], :if => Proc.new { |a| a.published? && a.image? && !a.parent.nil? && a.parent.gallery? }, :custom_target => :parent
 


=====================================
config/application.rb
=====================================
--- a/config/application.rb
+++ b/config/application.rb
@@ -1,7 +1,6 @@
 require_relative 'boot'
 
 require 'pp'
-require 'redcloth'
 require 'rails/all'
 
 # Silence Rails 5 deprecation warnings


=====================================
config/puma.rb
=====================================
--- a/config/puma.rb
+++ b/config/puma.rb
@@ -35,7 +35,7 @@ bind            "unix://#{RailsRoot}/run/puma.sock" if Production
 bind            "tcp://0.0.0.0:#{BindPort}" unless Production
 stdout_redirect "#{RailsRoot}/log/puma.stdout.log", "#{RailsRoot}/log/puma.stderr.log", true if Production
 
-workers Workers
+workers Workers unless RUBY_ENGINE == 'jruby'
 threads 0,Threads
 
 before_fork do



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/3601bf5b604ef0406af257a2f11d2ea424f7c2a7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170317/e44661ff/attachment-0001.html>


More information about the Noosfero-dev mailing list