redmine_crm 0.0.18 → 0.0.19

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
2
  SHA1:
3
- metadata.gz: d898d5a3d9ff5af93efe10532d38293df8a21e22
4
- data.tar.gz: 4f52bf19ea39abe32b0cfed726f4218cf8096b7d
3
+ metadata.gz: d3056eb68011716cb6d4ef47f1ccbd2cf8c6ef4a
4
+ data.tar.gz: c0381b69f22b09564830680e6c4dc6a75e79c24e
5
5
  SHA512:
6
- metadata.gz: 99ede1123b31e8ee8c752f2e95e3c9f7fd1ffb2ba78f78ac7c99b68b05ca9d731f742ca8fb1c93ff5fc3a1af35ef070c41986179be44f4d135c1706de8f4f985
7
- data.tar.gz: 901a381a3f17bd5849c8fcc80374e7e72c24aaf6b1b3f4283d4385c83d8e29f3283ec45672b8914b2c3bda1d62df590fc35c4afd6fbfe107d95c7c110ddd9fc9
6
+ metadata.gz: 6bf85404ae5d1af1f2a1d98c24190d9218a4a04f75b77ceee6161c2a8e66e8cb99d3d1b206880435035393ad955edb6e97c9699ce2bb96934256f92bc718169c
7
+ data.tar.gz: 6c76ef2ab80c866843bc84e3b5444fa4b0b38c73eb193cf1e613fec5f7968af8bf83fd86f9c8c5dc45932477dcda4a0c033f2b62a4859509d7a626fbebda8d30
data/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # RedmineCrm
2
2
 
3
3
  Gem include next functional for Redmine plugins:
4
- rcrm_acts_as_taggable
4
+ * rcrm_acts_as_taggable
5
+ * rcrm_acts_as_votable
6
+ * rcrm_acts_as_viewable
5
7
 
6
8
  ## Installation
7
9
 
@@ -20,14 +22,14 @@ Or install it yourself as:
20
22
  $ gem install redmine_crm
21
23
 
22
24
  Create migration with next code:
23
- ```ruby
25
+ ```ruby
24
26
  require 'redmine_crm/rcrm_acts_as_taggable'
25
27
 
26
28
  def self.up
27
29
  ActiveRecord::Base.create_taggable_table
28
30
  end
29
31
 
30
- def self.down
32
+ def self.down
31
33
  ActiveRecord::Base.drop_taggable_table
32
34
  end
33
35
  end
@@ -47,12 +49,6 @@ Add to model
47
49
  rcrm_acts_as_votable
48
50
  ```
49
51
 
50
- For use css and js from gem you may use code like this:
51
-
52
- <% content_for :header_tags do %>
53
- <%= javascript_include_tag "redmine_crm" %>
54
- <%= stylesheet_link_tag "redmine_crm" %>
55
- <% end %>
56
52
 
57
53
  ## Run test
58
54
 
@@ -4,6 +4,10 @@ Redmine crm gem - general functions for plugins (tags, vote, viewing, currency)
4
4
  Copyright (C) 2011-2015 RedmineCRM
5
5
  http://www.redminecrm.com/
6
6
 
7
+ == 2015-10-29 v0.0.19
8
+
9
+ * New requires_redmine_crm params format and error messages
10
+
7
11
  == 2015-10-28 v0.0.18
8
12
 
9
13
  * Rename 'requires_version' to 'requires_redmine_crm'
@@ -7,8 +7,6 @@ require "redmine_crm/rcrm_acts_as_taggable"
7
7
  require "redmine_crm/helpers/tags_helper"
8
8
  require "redmine_crm/currency"
9
9
  require "redmine_crm/money_helper"
10
-
11
- #version 0.10
12
10
  require "redmine_crm/rcrm_acts_as_votable"
13
11
  require "redmine_crm/rcrm_acts_as_voter"
14
12
  require "redmine_crm/vote"
@@ -20,43 +18,39 @@ if defined?(ActiveRecord::Base)
20
18
  ActiveRecord::Base.extend(RedmineCrm::ActsAsVotable::Voter)
21
19
  end
22
20
 
23
- module RedmineCrm
24
-
25
- # class PluginNotFound < StandardError; end
26
- class GemRequirementError < StandardError; end
21
+ def requires_redmine_crm(arg)
27
22
 
28
- def self.compare_versions(requirement, current)
23
+ def compare_versions(requirement, current)
29
24
  requirement = requirement.split('.').collect(&:to_i)
30
25
  requirement <=> current.slice(0, requirement.size)
31
26
  end
32
27
 
33
- def self.requires_redmine_crm(plugin, arg)
34
- arg = { :version_or_higher => arg } unless arg.is_a?(Hash)
35
- arg.assert_valid_keys(:version, :version_or_higher)
36
-
37
- current = VERSION.split(".").map{|x| x.to_i}
38
- arg.each do |k, req|
39
- case k
40
- when :version_or_higher
41
- raise ArgumentError.new(":version_or_higher accepts a version string only") unless req.is_a?(String)
42
- unless compare_versions(req, current) <= 0
43
- raise GemRequirementError.new("#{plugin} plugin requires RedmineCrm gem #{req} or higher but current is #{current.join('.')}")
28
+ arg = { :version_or_higher => arg } unless arg.is_a?(Hash)
29
+ arg.assert_valid_keys(:version, :version_or_higher)
30
+
31
+ current = RedmineCrm::VERSION.split(".").map{|x| x.to_i}
32
+ arg.each do |k, req|
33
+ case k
34
+ when :version_or_higher
35
+ raise ArgumentError.new(":version_or_higher accepts a version string only") unless req.is_a?(String)
36
+ unless compare_versions(req, current) <= 0
37
+ Rails.logger.error "\033[31m[ERROR]\033[0m Redmine requires redmine_crm gem version #{req} or higher (you're using #{RedmineCrm::VERSION}).\n\033[31m[ERROR]\033[0m Please update with 'bundle update redmine_crm'." if Rails.logger
38
+ abort "\033[31mRedmine requires redmine_crm gem version #{req} or higher (you're using #{RedmineCrm::VERSION}).\nPlease update with 'bundle update redmine_crm'.\033[0m"
39
+ end
40
+ when :version
41
+ req = [req] if req.is_a?(String)
42
+ if req.is_a?(Array)
43
+ unless req.detect {|ver| compare_versions(ver, current) == 0}
44
+ abort "\033[31mRedmine requires redmine_crm gem version #{req} (you're using #{RedmineCrm::VERSION}).\nPlease update with 'bundle update redmine_crm'.\033[0m"
44
45
  end
45
- when :version
46
- req = [req] if req.is_a?(String)
47
- if req.is_a?(Array)
48
- unless req.detect {|ver| compare_versions(ver, current) == 0}
49
- raise GemRequirementError.new("#{plugin} plugin requires one the following RedmineCrm versions: #{req.join(', ')} but current is #{current.join('.')}")
50
- end
51
- elsif req.is_a?(Range)
52
- unless compare_versions(req.first, current) <= 0 && compare_versions(req.last, current) >= 0
53
- raise GemRequirementError.new("#{plugin} plugin requires a RedmineCrm version between #{req.first} and #{req.last} but current is #{current.join('.')}")
54
- end
55
- else
56
- raise ArgumentError.new(":version option accepts a version string, an array or a range of versions")
46
+ elsif req.is_a?(Range)
47
+ unless compare_versions(req.first, current) <= 0 && compare_versions(req.last, current) >= 0
48
+ abort "\033[31mRedmine requires redmine_crm gem version between #{req.first} and #{req.last} (you're using #{RedmineCrm::VERSION}).\nPlease update with 'bundle update redmine_crm'.\033[0m"
57
49
  end
50
+ else
51
+ raise ArgumentError.new(":version option accepts a version string, an array or a range of versions")
58
52
  end
59
53
  end
60
- true
61
54
  end
55
+ true
62
56
  end
@@ -1,3 +1,3 @@
1
1
  module RedmineCrm
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = RedmineCrm::VERSION
9
9
  spec.authors = ["RedmineCRM"]
10
10
  spec.email = ["support@redminecrm.com"]
11
- spec.summary = %q{plugins for remine}
12
- spec.description = %q{plugins for Redmine}
11
+ spec.summary = %q{Common libraries for RedmineCRM plugins for Redmine}
12
+ spec.description = %q{Common libraries for RedmineCRM plugins for Redmine. Requered Redmine from http://redmine.org}
13
13
  spec.homepage = ""
14
14
  spec.license = "GPL2"
15
15
 
metadata CHANGED
@@ -1,16 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_crm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedmineCRM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-28 00:00:00.000000000 Z
11
+ date: 2015-10-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: plugins for Redmine
13
+ description: Common libraries for RedmineCRM plugins for Redmine. Requered Redmine
14
+ from http://redmine.org
14
15
  email:
15
16
  - support@redminecrm.com
16
17
  executables: []
@@ -91,7 +92,7 @@ rubyforge_project:
91
92
  rubygems_version: 2.2.2
92
93
  signing_key:
93
94
  specification_version: 4
94
- summary: plugins for remine
95
+ summary: Common libraries for RedmineCRM plugins for Redmine
95
96
  test_files:
96
97
  - test/acts_as_taggable_test.rb
97
98
  - test/currency_test.rb