infopark_reactor 1.26.0 → 1.26.1

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: 0e8434b8daf081b380a95c8e1dc9cd4862c7e735
4
- data.tar.gz: a24b736884d52b6b011a7bfbc1169dc6c04a28cf
3
+ metadata.gz: 786199197009c1597fd61cfad96bc7d7171d51f0
4
+ data.tar.gz: 970a4b224175eefab08cf9bb4274f95c968d6685
5
5
  SHA512:
6
- metadata.gz: 7869cd7e683b8a1adb5e446a9400a654759949defe5d709db195d0f50bbae186ca1b4b628ed16b3a30a7341d9b037d8910ff0667f6e8cd750dd5019689433a22
7
- data.tar.gz: e4c5fb4d5f3be48c69c913615ef159266c39cad7d348b0322d45109fb4670358efba11ddb8e6a319a64d995a7634aa3447f8f02f0ad624d2e8c6ce59bf74e20e
6
+ metadata.gz: 2ab0392bcd63beb6ffc56cad482da97e596c0e25d472d84610890367365bd705c1be57cd0cb0a5fa4a709c259ef634ef2b786c2e667460e4ae427ce97a234386
7
+ data.tar.gz: 8c289f307c39e92b97bf55e0be130af8846eda3fc942f5f7395195d45a42ca556cb844d3764bb559749b97c8853f598c934be75c7d875e578f288930461929ff
@@ -197,7 +197,7 @@ module Reactor
197
197
  def permalink=(value)
198
198
  set(:permalink, value)
199
199
  end
200
-
200
+
201
201
  def name=(value)
202
202
  set(:name, value)
203
203
  end
@@ -285,10 +285,10 @@ module Reactor
285
285
  # @deprecated
286
286
  def set_link(key, id_or_path_or_cms_obj)
287
287
  target_path = case id_or_path_or_cms_obj
288
- when Fixnum then Obj.find(id_or_path_or_cms_obj).path
288
+ when Integer then Obj.find(id_or_path_or_cms_obj).path
289
289
  when String then id_or_path_or_cms_obj
290
290
  when Obj then id_or_path_or_cms_obj.path
291
- else raise ArgumentError.new("Link target must Fixnum, String or Obj, but was #{id_or_path_or_cms_obj.class}.")
291
+ else raise ArgumentError.new("Link target must Integer, String or Obj, but was #{id_or_path_or_cms_obj.class}.")
292
292
  end
293
293
 
294
294
  edit!
@@ -315,7 +315,7 @@ module Reactor
315
315
  def allowed_attr?(attr)
316
316
  return true if builtin_attr?(attr)
317
317
 
318
- custom_attrs =
318
+ custom_attrs =
319
319
  self.singleton_class.send(:instance_variable_get, '@_o_allowed_attrs') ||
320
320
  self.class.send(:instance_variable_get, '@_o_allowed_attrs') ||
321
321
  []
@@ -5,7 +5,7 @@ module Reactor
5
5
  module Cm
6
6
  class Obj
7
7
  attr_reader :obj_id
8
- OBJ_ATTRS = [:permalink, :objClass, :workflowName, :name, :suppressExport, :parent]
8
+ OBJ_ATTRS = [:permalink, :objClass, :workflowName, :name, :suppressExport, :parent]
9
9
  ATTR_LENGTH_CONSTRAINT = {:name => 250, :title => 250}
10
10
 
11
11
  def self.create(name, parent, objClass)
@@ -249,6 +249,10 @@ module Reactor
249
249
  simple_command("release",msg)
250
250
  end
251
251
 
252
+ def unrelease!(msg=nil)
253
+ simple_command("unrelease",msg)
254
+ end
255
+
252
256
  def edit!(msg=nil)
253
257
  simple_command("edit",msg)
254
258
  end
@@ -317,7 +321,7 @@ module Reactor
317
321
  end
318
322
  xml.tag!('content-resolveRefs')
319
323
  end
320
- response = request.execute!
324
+ request.execute!
321
325
  end
322
326
 
323
327
  def path
@@ -360,7 +364,7 @@ module Reactor
360
364
  xml.get_key_tag!('content', 'workflowComment')
361
365
  end
362
366
  response = request.execute!
363
- result = response.xpath('//workflowComment/*').map {|x| x.text.to_s}.first
367
+ response.xpath('//workflowComment/*').map {|x| x.text.to_s}.first
364
368
  end
365
369
 
366
370
  def editor
@@ -418,7 +422,7 @@ module Reactor
418
422
  xml.tag!("#{base_name}-#{cmd_name}")
419
423
  end
420
424
  end
421
- response = @request.execute!
425
+ @request.execute!
422
426
  end
423
427
 
424
428
  def base_name
@@ -46,10 +46,10 @@ module Reactor
46
46
 
47
47
  def obj_from_anything(anything)
48
48
  case anything
49
- when Fixnum then RailsConnector::AbstractObj.find(anything)
49
+ when Integer then RailsConnector::AbstractObj.find(anything)
50
50
  when String then RailsConnector::AbstractObj.find_by_path(anything)
51
51
  when RailsConnector::AbstractObj then anything
52
- else raise ArgumentError, "Link target must Fixnum, String or Obj, but was #{anything.class}."
52
+ else raise ArgumentError, "Link target must Integer, String or Obj, but was #{anything.class}."
53
53
  end
54
54
  end
55
55
 
@@ -11,11 +11,11 @@ module Reactor
11
11
 
12
12
  def initialize(anything)
13
13
  link_data = {}
14
-
14
+
15
15
  case anything
16
16
  when Hash
17
17
  link_data = anything
18
- when Fixnum
18
+ when Integer
19
19
  link_data[:url] = RailsConnector::AbstractObj.find(anything).path
20
20
  else
21
21
  link_data[:url] = anything
@@ -38,6 +38,18 @@ module Reactor
38
38
  return false
39
39
  end
40
40
 
41
+ # Unreleases the object. Returns true on success,
42
+ # false when one of the following occurs:
43
+ # 1. user lacks the permissions
44
+ # 2. the object is not released
45
+ # 3. object is invalid
46
+ # 4. other error occoured
47
+ def unrelease(comment=nil)
48
+ return unrelease!(comment)
49
+ rescue Reactor::Cm::XmlRequestError, ActiveRecord::RecordInvalid, Reactor::NotPermitted
50
+ return false
51
+ end
52
+
41
53
  # Removes the working version of the object,
42
54
  # if it exists
43
55
  # @param comment [String] comment to leave for the next user
@@ -71,6 +83,14 @@ module Reactor
71
83
  return true
72
84
  end
73
85
 
86
+ # Unreleases the object. Returns true on succes, can raise exceptions
87
+ # @param comment [String] comment to leave for the next user
88
+ def unrelease!(comment=nil)
89
+ crul_obj.unrelease!(comment)
90
+ reload
91
+ return true
92
+ end
93
+
74
94
  # Makes the current user the editor of the object. Returns true when
75
95
  # user is already the editor or take succeded,
76
96
  # false when one of the following occurs:
@@ -289,7 +309,7 @@ module Reactor
289
309
  end
290
310
 
291
311
  def changed_linklists
292
- custom_attrs =
312
+ custom_attrs =
293
313
  self.singleton_class.send(:instance_variable_get, '@_o_allowed_attrs') ||
294
314
  self.class.send(:instance_variable_get, '@_o_allowed_attrs') ||
295
315
  []
@@ -490,7 +510,7 @@ module Reactor
490
510
 
491
511
  if subclass_name.present? && subclass_name != self.name
492
512
  subclass = subclass_name.safe_constantize
493
-
513
+
494
514
  if subclass # this if has been added
495
515
  unless descendants.include?(subclass)
496
516
  raise ActiveRecord::SubclassNotFound.new("Invalid single-table inheritance type: #{subclass_name} is not a subclass of #{name}")
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Reactor
3
- VERSION = "1.26.0"
3
+ VERSION = "1.26.1"
4
4
  end
metadata CHANGED
@@ -1,75 +1,75 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark_reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.26.0
4
+ version: 1.26.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Przedmojski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-15 00:00:00.000000000 Z
11
+ date: 2018-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.0.10
20
- - - <
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 4.3.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.0.10
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 4.3.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: nokogiri
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - '>='
37
+ - - ">="
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - '>='
44
+ - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - '>='
51
+ - - ">="
52
52
  - !ruby/object:Gem::Version
53
53
  version: '0'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: yard
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  description: Use the ActiveRecord mimicking API to write into CM and enjoy all the
@@ -80,7 +80,7 @@ executables: []
80
80
  extensions: []
81
81
  extra_rdoc_files: []
82
82
  files:
83
- - .gitignore
83
+ - ".gitignore"
84
84
  - Gemfile
85
85
  - LICENSE
86
86
  - Rakefile
@@ -215,17 +215,17 @@ require_paths:
215
215
  - lib
216
216
  required_ruby_version: !ruby/object:Gem::Requirement
217
217
  requirements:
218
- - - '>='
218
+ - - ">="
219
219
  - !ruby/object:Gem::Version
220
220
  version: '0'
221
221
  required_rubygems_version: !ruby/object:Gem::Requirement
222
222
  requirements:
223
- - - '>='
223
+ - - ">="
224
224
  - !ruby/object:Gem::Version
225
225
  version: '0'
226
226
  requirements: []
227
227
  rubyforge_project:
228
- rubygems_version: 2.0.14.1
228
+ rubygems_version: 2.5.2.1
229
229
  signing_key:
230
230
  specification_version: 4
231
231
  summary: Write into CM in familiar, Rails-like way