marklogic 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +0 -1
- data/lib/marklogic/app_server.rb +22 -1
- data/lib/marklogic/application.rb +7 -3
- data/lib/marklogic/database.rb +0 -1
- data/lib/marklogic/object_id.rb +4 -0
- data/lib/marklogic/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d630ea9227431bc2339117e02456e17c96bdb7de
|
4
|
+
data.tar.gz: c8741db2ec72dae75010e739f35ff7f0013796f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d0fd37ade1ca5348ce7486fd7d6bdad7c20094906da9be1e343de4cee416b432e9655a54a208da31deabfe5945b6c7d07589435d6ffe022939c2d207b100224
|
7
|
+
data.tar.gz: 26065027c06a9ac0a811c3284431dce148031485300225dd444c7ccda8d506eb4339ae2e04fd277858225bd36d62df32ad68a48ceac22c3a69e5ecb38aee5481
|
data/Rakefile
CHANGED
data/lib/marklogic/app_server.rb
CHANGED
@@ -22,7 +22,8 @@ module MarkLogic
|
|
22
22
|
"modules-database" => modules_database,
|
23
23
|
"url-rewriter" => "/MarkLogic/rest-api/rewriter.xml",
|
24
24
|
"error-handler" => "/MarkLogic/rest-api/error-handler.xqy",
|
25
|
-
"rewrite-resolves-globally" => true
|
25
|
+
"rewrite-resolves-globally" => true,
|
26
|
+
"group-name" => @group_name
|
26
27
|
}
|
27
28
|
end
|
28
29
|
|
@@ -69,6 +70,26 @@ module MarkLogic
|
|
69
70
|
@options)
|
70
71
|
end
|
71
72
|
|
73
|
+
def update
|
74
|
+
url = %Q{/manage/v2/servers/#{server_name}/properties?format=json}
|
75
|
+
r = manage_connection.put(url, JSON.generate(to_json))
|
76
|
+
binding.pry
|
77
|
+
r
|
78
|
+
end
|
79
|
+
|
80
|
+
def to_json
|
81
|
+
json = {}
|
82
|
+
@options.each do |k, v|
|
83
|
+
if v.kind_of?(Array)
|
84
|
+
value = v.map { |item| item.to_json }
|
85
|
+
else
|
86
|
+
value = v
|
87
|
+
end
|
88
|
+
json[k] = value
|
89
|
+
end
|
90
|
+
json
|
91
|
+
end
|
92
|
+
|
72
93
|
def drop
|
73
94
|
r = manage_connection.delete(%Q{/manage/v2/servers/#{server_name}?group-id=#{group_name}&format=json})
|
74
95
|
|
@@ -29,7 +29,11 @@ module MarkLogic
|
|
29
29
|
end
|
30
30
|
|
31
31
|
app_servers.each do |server_name, app_server|
|
32
|
-
|
32
|
+
unless app_server.exists?
|
33
|
+
app_server.create
|
34
|
+
else
|
35
|
+
app_server.update
|
36
|
+
end
|
33
37
|
end
|
34
38
|
|
35
39
|
end
|
@@ -165,15 +169,15 @@ module MarkLogic
|
|
165
169
|
|
166
170
|
def database(name)
|
167
171
|
database = MarkLogic::Database.new(name, self.connection)
|
168
|
-
yield(database) if block_given?
|
169
172
|
database.application = self
|
170
173
|
databases[name] = database
|
174
|
+
yield(database) if block_given?
|
171
175
|
end
|
172
176
|
|
173
177
|
def app_server(name)
|
174
178
|
app_server = MarkLogic::AppServer.new(name, @port)
|
175
|
-
yield(app_server) if block_given?
|
176
179
|
app_servers[name] = app_server
|
180
|
+
yield(app_server) if block_given?
|
177
181
|
end
|
178
182
|
|
179
183
|
def inspect
|
data/lib/marklogic/database.rb
CHANGED
data/lib/marklogic/object_id.rb
CHANGED
data/lib/marklogic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marklogic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paxton Hare
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http-persistent
|