lucid_works 0.6.26 → 0.6.27

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,7 @@ en:
7
7
  one: Activity
8
8
  other: Activities
9
9
  type:
10
- autocomplete: Generate autocompete index
10
+ autocomplete: Generate autocomplete index
11
11
  click: Process click logs
12
12
  optimize: Optimize index
13
13
  spelling: Generate spellcheck index
@@ -130,4 +130,8 @@ en:
130
130
  kdcserver: Kerberos KDC server
131
131
  useSPSearchVisibility: Use SP Search Visibility
132
132
  aliases: Site Aliases Mappings
133
-
133
+ # errors:
134
+ # models:
135
+ # lucid_works:
136
+ # collection:
137
+ # exclusion: is reserved
@@ -13,12 +13,20 @@ module LucidWorks
13
13
  attribute :template
14
14
  end
15
15
 
16
+ LOGS_COLLECTION_NAME = 'LucidWorksLogs'
17
+
16
18
  validates_presence_of :name
19
+ validates_exclusion_of :name, :in => [LOGS_COLLECTION_NAME]
17
20
 
18
21
  def destroyable?
19
22
  true
20
23
  end
21
24
 
25
+ # is this a 'system' collection
26
+ def system?
27
+ name == LOGS_COLLECTION_NAME
28
+ end
29
+
22
30
  def empty!
23
31
  build_index.destroy(:params => {:key => 'iaccepttherisk'})
24
32
  end
@@ -86,13 +86,14 @@ module LucidWorks
86
86
  build_index.destroy
87
87
  end
88
88
 
89
+ # Don't let user edit data sources of system collections
89
90
  def editable?
90
- true
91
+ !collection.system?
91
92
  end
92
93
 
93
94
  def destroyable?
94
- # Don't let user destroy logs data source
95
- type != 'lucidworkslogs'
95
+ # Don't let user destroy data sources of system collections
96
+ !collection.system?
96
97
  end
97
98
 
98
99
  def crawlable?
@@ -1,3 +1,3 @@
1
1
  module LucidWorks
2
- VERSION = "0.6.26"
2
+ VERSION = "0.6.27"
3
3
  end
@@ -55,6 +55,21 @@ describe LucidWorks::Collection do
55
55
  c.errors[:name].should include "collection already exists"
56
56
  end
57
57
  end
58
+
59
+ context "with a reserved name" do
60
+ before do
61
+ logs = @server.collection(LucidWorks::Collection::LOGS_COLLECTION_NAME) rescue nil
62
+ logs.destroy if logs
63
+ @name = LucidWorks::Collection::LOGS_COLLECTION_NAME
64
+ end
65
+
66
+ it "should not create" do
67
+ c = LucidWorks::Collection.create(:name => @name, :parent => @server)
68
+ c.should_not be_persisted
69
+ c.errors.should_not be_empty
70
+ c.errors[:name].should include "is reserved"
71
+ end
72
+ end
58
73
  end
59
74
 
60
75
  describe ".find" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lucid_works
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.26
4
+ version: 0.6.27
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-07-06 00:00:00.000000000 -07:00
12
+ date: 2011-07-07 00:00:00.000000000 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
17
- requirement: &2168719880 !ruby/object:Gem::Requirement
17
+ requirement: &2161089740 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '3'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2168719880
25
+ version_requirements: *2161089740
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activemodel
28
- requirement: &2168719380 !ruby/object:Gem::Requirement
28
+ requirement: &2161089240 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '3'
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *2168719380
36
+ version_requirements: *2161089240
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rest-client
39
- requirement: &2168718920 !ruby/object:Gem::Requirement
39
+ requirement: &2161088780 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.6.1
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *2168718920
47
+ version_requirements: *2161088780
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: json
50
- requirement: &2168718540 !ruby/object:Gem::Requirement
50
+ requirement: &2161088400 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ! '>='
@@ -55,10 +55,10 @@ dependencies:
55
55
  version: '0'
56
56
  type: :runtime
57
57
  prerelease: false
58
- version_requirements: *2168718540
58
+ version_requirements: *2161088400
59
59
  - !ruby/object:Gem::Dependency
60
60
  name: rsolr
61
- requirement: &2168718080 !ruby/object:Gem::Requirement
61
+ requirement: &2161087940 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ! '>='
@@ -66,10 +66,10 @@ dependencies:
66
66
  version: '0'
67
67
  type: :runtime
68
68
  prerelease: false
69
- version_requirements: *2168718080
69
+ version_requirements: *2161087940
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: rsolr-ext
72
- requirement: &2168717660 !ruby/object:Gem::Requirement
72
+ requirement: &2161087520 !ruby/object:Gem::Requirement
73
73
  none: false
74
74
  requirements:
75
75
  - - ! '>='
@@ -77,10 +77,10 @@ dependencies:
77
77
  version: '0'
78
78
  type: :runtime
79
79
  prerelease: false
80
- version_requirements: *2168717660
80
+ version_requirements: *2161087520
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: nokogiri
83
- requirement: &2168717240 !ruby/object:Gem::Requirement
83
+ requirement: &2161087100 !ruby/object:Gem::Requirement
84
84
  none: false
85
85
  requirements:
86
86
  - - ! '>='
@@ -88,7 +88,7 @@ dependencies:
88
88
  version: '0'
89
89
  type: :runtime
90
90
  prerelease: false
91
- version_requirements: *2168717240
91
+ version_requirements: *2161087100
92
92
  description: Ruby wrapper for the LucidWorks REST API
93
93
  email:
94
94
  - sam.pierson@lucidimagination.com