redmine_crm 0.0.56 → 0.0.57

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 153c60f66d4c53d47d65468f86359268be877a69
4
- data.tar.gz: c2c8ad9b9e028b429f142aca1bc84a329071a966
2
+ SHA256:
3
+ metadata.gz: 214cac797343372370ee81fb9edd38aba5e67ce9d47ad15276952da329f6f876
4
+ data.tar.gz: d1b987d030f3c4fcd6c10c6cfdd3cb42c8b7bbd2014ce2ab1653c6adce75f3e7
5
5
  SHA512:
6
- metadata.gz: 1c3520707b176c33109e389a25145024d5e386f98bdc18a25a26af8595abe6ae598c639a4ef53da75bf23e7f582510d7c97bc038f7b350eda90d030dd85a3b7f
7
- data.tar.gz: a3c10fc13ca1ee1d4474cc349039ef67b26d5ea47ccefc71afb71c276b15063a5b7a290a498e9e1dc412592f6f190a65504bc66a769a5818686588749d3e652e
6
+ metadata.gz: 94df5375a9504037d560bcd3da69c76d1915539056e3da79978c3548d950364afb09e594a6c4ef478e8901aa84ee407c66426d8aecc98f882929a94e43d3ab9e
7
+ data.tar.gz: 239c0df29c90a226d5ba7c62d5838a60311b3e3a6ac6dc70bcbeb4361f5fa130b0133de2ac1d83527a5850572e37153fa394d9a64eea6301c6946853170b4a08
@@ -19,26 +19,6 @@ pipelines:
19
19
  services:
20
20
  - mysql
21
21
  - postgres
22
- - step:
23
- name: Old ruby
24
- image: ruby:1.9.3
25
- script:
26
- - sed -i "s/'rails'/'rails'\n spec.add_runtime_dependency 'rake', '~> 11.2.0'/g" redmine_crm.gemspec
27
- - sed -i "s/'rails'/'rails'\n spec.add_runtime_dependency 'i18n', '~> 0.9.5'/g" redmine_crm.gemspec
28
- - sed -i "s/'rails'/'rails'\n spec.add_runtime_dependency 'nokogiri', '~> 1.6.8'/g" redmine_crm.gemspec
29
- - sed -i "s/'rails'/'rails', '~> 4.2.11'/g" redmine_crm.gemspec
30
- - sed -i "s/'sqlite3'/'sqlite3', '~> 1.3.6'/g" redmine_crm.gemspec
31
- - sed -i "s/'mysql2'/'mysql2', '~> 0.4.0'/g" redmine_crm.gemspec
32
- - sed -i "s/'pg'/'pg', '~> 0.18.0'/g" redmine_crm.gemspec
33
- - sed -i "s/^end/ spec.add_development_dependency 'minitest', '~> 5.11.3'\nend/g" redmine_crm.gemspec
34
- - sed -i "s/^end/ spec.add_development_dependency 'sprockets', '~> 3.5.2'\nend/g" redmine_crm.gemspec
35
- - sed -i "s/^end/ spec.add_development_dependency 'thor', '~> 0.20.3'\nend/g" redmine_crm.gemspec
36
- - sed -i "s/'rubyzip'/'rubyzip', '~> 1.3.0'/g" redmine_crm.gemspec
37
- - bundle install
38
- - bundle exec rake test DB=sqlite
39
- - bundle exec rake test DB=mysql
40
- services:
41
- - mysql
42
22
 
43
23
  definitions:
44
24
  services:
data/doc/CHANGELOG CHANGED
@@ -4,6 +4,10 @@ Redmine crm gem - general functions for plugins (tags, vote, viewing, currency)
4
4
  Copyright (C) 2011-2022 RedmineUP
5
5
  https://www.redmineup.com/
6
6
 
7
+ == 2022-02-14 v0.0.57
8
+
9
+ * Fixed BigDecimal liquid bug for ruby > 2.6
10
+
7
11
  == 2022-02-14 v0.0.56
8
12
 
9
13
  * Added rcrm_acts_as_priceable
@@ -0,0 +1,33 @@
1
+ module RedmineCrm
2
+ module Patches
3
+ module LiquidPatch
4
+ module StandardFilters
5
+
6
+ def self.included(base)
7
+ base.class_eval do
8
+
9
+ private
10
+
11
+ def to_number(obj)
12
+ case obj
13
+ when Float
14
+ BigDecimal(obj.to_s)
15
+ when Numeric
16
+ obj
17
+ when String
18
+ (obj.strip =~ /^\d+\.\d+$/) ? BigDecimal(obj) : obj.to_i
19
+ else
20
+ 0
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ end
27
+ end
28
+ end
29
+ end
30
+
31
+ unless Liquid::StandardFilters.included_modules.include?(RedmineCrm::Patches::LiquidPatch::StandardFilters)
32
+ Liquid::StandardFilters.send(:include, RedmineCrm::Patches::LiquidPatch::StandardFilters)
33
+ end
@@ -1,3 +1,3 @@
1
1
  module RedmineCrm
2
- VERSION = '0.0.56'
2
+ VERSION = '0.0.57'
3
3
  end
data/lib/redmine_crm.rb CHANGED
@@ -43,6 +43,7 @@ require 'redmine_crm/helpers/form_tag_helper'
43
43
  require 'redmine_crm/assets_manager'
44
44
 
45
45
  require 'redmine_crm/compatibility/application_controller_patch'
46
+ require 'redmine_crm/patches/liquid_patch' unless BigDecimal.respond_to?(:new)
46
47
 
47
48
  module RedmineCrm
48
49
  GEM_NAME = 'redmine_crm'.freeze
data/redmine_crm.gemspec CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
+ spec.required_ruby_version = ">= 2.0.0"
20
21
 
21
22
  spec.add_runtime_dependency 'rails'
22
23
  spec.add_runtime_dependency 'liquid', '< 2.6.4'
@@ -52,6 +52,10 @@ module RedmineCrm
52
52
  assert_equal '25', @liquid_render.render("{{24.11 | ceil }}")
53
53
  end
54
54
 
55
+ def test_big_decimal_filter_patch
56
+ assert_equal '2.8571', @liquid_render.render("{{ 20 | divided_by: 7.0 | round: 4 }}")
57
+ end
58
+
55
59
  def test_floor_filter
56
60
  assert_equal '24', @liquid_render.render("{{24.99 | floor }}")
57
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_crm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.56
4
+ version: 0.0.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedmineUP
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-15 00:00:00.000000000 Z
11
+ date: 2022-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -157,6 +157,7 @@ files:
157
157
  - lib/redmine_crm/liquid/filters/base.rb
158
158
  - lib/redmine_crm/liquid/filters/colors.rb
159
159
  - lib/redmine_crm/money_helper.rb
160
+ - lib/redmine_crm/patches/liquid_patch.rb
160
161
  - lib/redmine_crm/settings.rb
161
162
  - lib/redmine_crm/settings/money.rb
162
163
  - lib/redmine_crm/version.rb
@@ -222,15 +223,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
222
223
  requirements:
223
224
  - - ">="
224
225
  - !ruby/object:Gem::Version
225
- version: '0'
226
+ version: 2.0.0
226
227
  required_rubygems_version: !ruby/object:Gem::Requirement
227
228
  requirements:
228
229
  - - ">="
229
230
  - !ruby/object:Gem::Version
230
231
  version: '0'
231
232
  requirements: []
232
- rubyforge_project:
233
- rubygems_version: 2.6.11
233
+ rubygems_version: 3.1.2
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: Common libraries for RedmineUP plugins for Redmine