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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcfb58c30b2f0b132461bab1b934cbd64b7d4df4
4
- data.tar.gz: 22bf7dfb391a817ed1130f6206308cdf99661002
3
+ metadata.gz: d630ea9227431bc2339117e02456e17c96bdb7de
4
+ data.tar.gz: c8741db2ec72dae75010e739f35ff7f0013796f7
5
5
  SHA512:
6
- metadata.gz: b6fe14f7b6c88e5584dfe13c857604c0c8ad653addf7bd20d7d2a06dff4ea6bb2c98116ef8b4b97c4b375ca347f887d95385ee51db504708eaef5391d5458169
7
- data.tar.gz: 6a953b57b48b24ea0bb710a834172ec560b3b8793f9164a4f25ef522db050c9cba3e2458d062fe0f1a83b61c64c3bd73331dadd86aaaa262f071e7f95041791c
6
+ metadata.gz: 7d0fd37ade1ca5348ce7486fd7d6bdad7c20094906da9be1e343de4cee416b432e9655a54a208da31deabfe5945b6c7d07589435d6ffe022939c2d207b100224
7
+ data.tar.gz: 26065027c06a9ac0a811c3284431dce148031485300225dd444c7ccda8d506eb4339ae2e04fd277858225bd36d62df32ad68a48ceac22c3a69e5ecb38aee5481
data/Rakefile CHANGED
@@ -21,6 +21,5 @@ desc 'Tags version, pushes to remote, and pushes gem'
21
21
  task :release => :build do
22
22
  sh "git tag v#{MarkLogic::Version}"
23
23
  sh "git push origin master"
24
- sh "git push origin v#{MarkLogic::Version}"
25
24
  sh "gem push marklogic-#{MarkLogic::Version}.gem"
26
25
  end
@@ -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
- app_server.create unless app_server.exists?
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
@@ -177,7 +177,6 @@ module MarkLogic
177
177
  end
178
178
  json[k] = value
179
179
  end
180
- # puts json
181
180
  json
182
181
  end
183
182
 
@@ -13,6 +13,10 @@ module MarkLogic
13
13
  @id
14
14
  end
15
15
 
16
+ def inspect
17
+ "#<#{self.class}('#{@id}')>"
18
+ end
19
+
16
20
  class << self
17
21
  def from_string(str)
18
22
  object_id = allocate
@@ -1,3 +1,3 @@
1
1
  module MarkLogic
2
- Version = "0.0.7"
2
+ Version = "0.0.8"
3
3
  end
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.7
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-16 00:00:00.000000000 Z
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