desmoservice 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2161b9b8e4dadbd49e0fb3821c25d3b90fc8c236
4
- data.tar.gz: f2df8f17e1d746c270a92ba13f5c9cefd36218ec
3
+ metadata.gz: 53601aca065853e7d08dd36b56eb2d752ef83cde
4
+ data.tar.gz: 8a95a90928090db6a8c5f698157dce99d29284df
5
5
  SHA512:
6
- metadata.gz: 7f67a71402b0765a9c877a0553431d61a6fb993637c23c2ef00e3116347fc2103caba6279c6e28df15d5cb06783f434b484231754d612d0f893dfd567ee46abd
7
- data.tar.gz: c06871d72b3bf9c35d81d185a84dcc6b7b82715497fb1daceb240c616666b42d07c25d5e11d62ad24330f233112178ce225ba9216af62284e2e6ad5bf0c64491
6
+ metadata.gz: 237d9771944a2d164210e4ea116cfe19344c8f88710bdc62dc8d04aa9add3b119d4214d20f926a7e57d6adc6bdea3458c18470fa261fae472084fbec76132b15
7
+ data.tar.gz: 65986d9863b939bdb97716380fbb241642cfd1fa5d558ff6ce854fe602a46f2554c96e008ce42bab857c122399100e2e6dd822ad592e70361e29d824a18da1ad
data/LICENSE ADDED
@@ -0,0 +1,56 @@
1
+ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
2
+ You can redistribute it and/or modify it under either the terms of the
3
+ 2-clause BSDL (see the file BSDL), or the conditions below:
4
+
5
+ 1. You may make and give away verbatim copies of the source form of the
6
+ software without restriction, provided that you duplicate all of the
7
+ original copyright notices and associated disclaimers.
8
+
9
+ 2. You may modify your copy of the software in any way, provided that
10
+ you do at least ONE of the following:
11
+
12
+ a) place your modifications in the Public Domain or otherwise
13
+ make them Freely Available, such as by posting said
14
+ modifications to Usenet or an equivalent medium, or by allowing
15
+ the author to include your modifications in the software.
16
+
17
+ b) use the modified software only within your corporation or
18
+ organization.
19
+
20
+ c) give non-standard binaries non-standard names, with
21
+ instructions on where to get the original software distribution.
22
+
23
+ d) make other distribution arrangements with the author.
24
+
25
+ 3. You may distribute the software in object code or binary form,
26
+ provided that you do at least ONE of the following:
27
+
28
+ a) distribute the binaries and library files of the software,
29
+ together with instructions (in the manual page or equivalent)
30
+ on where to get the original distribution.
31
+
32
+ b) accompany the distribution with the machine-readable source of
33
+ the software.
34
+
35
+ c) give non-standard binaries non-standard names, with
36
+ instructions on where to get the original software distribution.
37
+
38
+ d) make other distribution arrangements with the author.
39
+
40
+ 4. You may modify and include the part of the software into any other
41
+ software (possibly commercial). But some files in the distribution
42
+ are not written by the author, so that they are not under these terms.
43
+
44
+ For the list of those files and their copying conditions, see the
45
+ file LEGAL.
46
+
47
+ 5. The scripts and library files supplied as input to or produced as
48
+ output from the software do not automatically fall under the
49
+ copyright of the software, but belong to whomever generated them,
50
+ and may be sold commercially, and may be aggregated with this
51
+ software.
52
+
53
+ 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
54
+ IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
55
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
56
+ PURPOSE.
data/desmoservice.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'desmoservice'
3
- s.version = '0.0.0'
4
- s.date = '2015-09-20'
3
+ s.version = '0.1.0'
4
+ s.date = '2015-09-23'
5
5
  s.license = 'Ruby'
6
6
  s.summary = 'Read and write access to Desmoservice API'
7
7
  s.description = 'Manage the connection to Desmoservice server, convert JSON to ruby objects and build XML for edition'
data/lib/edition.rb CHANGED
@@ -13,19 +13,19 @@ class Edition
13
13
  end
14
14
 
15
15
  #arg peut être un entier (id) ou une chaine (localkey)
16
- def link_creation(down_arg=nil)
16
+ def create_ligature(inferior_arg=nil)
17
17
  @xml << '<lienhierarchique-creation'
18
- Edition.to_attribute(@xml, down_arg, 'fils')
18
+ Edition.to_attribute(@xml, inferior_arg, 'fils')
19
19
  @xml << '>'
20
- yield(LinkCreation.new(@xml))
20
+ yield(LigatureEdit.new(@xml))
21
21
  @xml << '</lienhierarchique-creation>'
22
22
  end
23
23
 
24
- def term_change(term_arg)
24
+ def change_term(term_arg)
25
25
  @xml << '<terme-change'
26
26
  Edition.to_attribute(@xml, term_arg)
27
27
  @xml << '>'
28
- yield(TermChange.new(@xml))
28
+ yield(TermEdit.new(@xml))
29
29
  @xml << '</terme-change>'
30
30
  end
31
31
 
@@ -85,17 +85,24 @@ class Edition
85
85
  xml << '</attr>'
86
86
  end
87
87
  end
88
+
89
+ def self.key_prefix(xml, key_prefix_arg)
90
+ xml << '<key-prefix>'
91
+ xml << Rack::Utils.escape_html(key_prefix_arg)
92
+ xml << '</key-prefix>'
93
+ end
94
+
88
95
  end
89
96
 
90
- class LinkCreation
97
+ class LigatureEdit
91
98
 
92
99
  def initialize(xml)
93
100
  @xml = xml
94
101
  end
95
102
 
96
- def up(up_arg, context_arg=nil)
103
+ def superior(superior_arg, context_arg=nil)
97
104
  @xml << '<pere'
98
- Edition.to_attribute(@xml, up_arg)
105
+ Edition.to_attribute(@xml, superior_arg)
99
106
  if not context_arg.nil?
100
107
  if context_arg.is_a? Integer
101
108
  @xml << ' contexte="' << context_arg.to_s << '"'
@@ -119,9 +126,13 @@ class LinkCreation
119
126
  def attr(attr_key, values)
120
127
  Edition.attr(@xml, attr_key, values)
121
128
  end
129
+
130
+ def key_prefix(key_prefix_arg)
131
+ Edition.key_prefix(@xml, key_prefix_arg)
132
+ end
122
133
  end
123
134
 
124
- class TermChange
135
+ class TermEdit
125
136
 
126
137
  def initialize(xml)
127
138
  @xml = xml
data/lib/log_handler.rb CHANGED
@@ -5,7 +5,6 @@ class LogHandler
5
5
 
6
6
  def initialize(destination)
7
7
  @destination = destination
8
-
9
8
  end
10
9
 
11
10
  def add_log_message(log_message)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: desmoservice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vincent Calame
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-20 00:00:00.000000000 Z
11
+ date: 2015-09-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Manage the connection to Desmoservice server, convert JSON to ruby objects
14
14
  and build XML for edition
@@ -31,6 +31,7 @@ files:
31
31
  - lib/sector.rb
32
32
  - lib/post.rb
33
33
  - lib/word_distribution.rb
34
+ - LICENSE
34
35
  - test/test_edition.rb
35
36
  - test/test_families.rb
36
37
  - test/test_conf.rb