limeade 0.1.2 → 0.1.3
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 +5 -5
- data/lib/limeade/client.rb +62 -16
- data/lib/limeade/version.rb +1 -1
- data/limeade.gemspec +1 -1
- metadata +13 -9
- data/lib/limeade/methods.rb +0 -55
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bb14f9082aa25256534bdfe452342afa8e85c91f6865af7018ba29ba1bec0da6
|
4
|
+
data.tar.gz: 1eb9ce140d18269679297942b43eebc05999262f04b1e8458fc434b48370fa1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '06690414adef52692099da672515d777a452f7e6cf2b1cd4e5bd6f81c4e92e09b9dc0725a5408c6474427be1c26c5726ccce931667ac0f8ccc81a24e111c6ff8'
|
7
|
+
data.tar.gz: e1e0b2bce2473578c58d1e72c0f461d2b044fbc673ac08c435c2a36b739784d9e098e27bc77e53f1007146494e3c2b9cab44372dce07880d3ad2600f204a4c9e
|
data/lib/limeade/client.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'limeade/methods'
|
2
|
-
|
3
1
|
module Limeade
|
4
2
|
# Client for accessing the LimeSurvey RemoteControl API from Ruby.
|
5
3
|
class Client
|
@@ -65,25 +63,73 @@ module Limeade
|
|
65
63
|
end
|
66
64
|
end
|
67
65
|
|
68
|
-
#
|
69
|
-
# @param method [Symbol] the method invoked
|
70
|
-
# @param arguments [Array] the arguments to the method
|
66
|
+
# Define a LimeSurvey RemoteControl API method call.
|
71
67
|
#
|
72
|
-
# @
|
73
|
-
# @
|
68
|
+
# @param ruby_method [Symbol] the name of the ruby method to define
|
69
|
+
# @param rpc_method [Symbol, String] the name of the JSON RPC method to call
|
70
|
+
# @!macro [attach] define_api_method
|
71
|
+
# @method $1
|
72
|
+
# Invoke the +${-1}+ JSON RPC method on the given endpoint.
|
74
73
|
#
|
75
|
-
#
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
74
|
+
# @see https://api.limesurvey.org/classes/remotecontrol_handle.html#method_${-1}
|
75
|
+
# @param [variable] *arguments see LimeSurvey documentation
|
76
|
+
# @raise [ServerError] The API endpoint server is having issues. An error code and message are included.
|
77
|
+
# @raise [InvalidResponseError] The API endpoint is returning malformed JSON RPC responses. A descriptive message
|
78
|
+
# @return [Object] the result of invoking the method on the endpoint
|
79
|
+
def self.define_api_method(ruby_method, rpc_method = ruby_method)
|
80
|
+
define_method(ruby_method) do |*arguments|
|
81
|
+
process_request(rpc_method, *arguments)
|
81
82
|
end
|
82
83
|
end
|
83
84
|
|
84
|
-
|
85
|
-
|
86
|
-
|
85
|
+
define_api_method :activate_survey
|
86
|
+
define_api_method :activate_tokens
|
87
|
+
define_api_method :add_group
|
88
|
+
define_api_method :add_language
|
89
|
+
define_api_method :add_participants
|
90
|
+
define_api_method :add_response
|
91
|
+
define_api_method :add_survey
|
92
|
+
define_api_method :copy_survey
|
93
|
+
define_api_method :cpd_importParticipants
|
94
|
+
define_api_method :delete_group
|
95
|
+
define_api_method :delete_language
|
96
|
+
define_api_method :delete_participants
|
97
|
+
define_api_method :delete_question
|
98
|
+
define_api_method :delete_survey
|
99
|
+
define_api_method :export_responses
|
100
|
+
define_api_method :export_responses_by_token
|
101
|
+
define_api_method :export_statistics
|
102
|
+
define_api_method :export_timeline
|
103
|
+
define_api_method :get_group_properties
|
104
|
+
define_api_method :get_language_properties
|
105
|
+
define_api_method :get_participant_properties
|
106
|
+
define_api_method :get_question_properties
|
107
|
+
define_api_method :get_response_ids
|
108
|
+
define_api_method :get_session_key
|
109
|
+
define_api_method :get_site_settings
|
110
|
+
define_api_method :get_summary
|
111
|
+
define_api_method :get_survey_properties
|
112
|
+
define_api_method :get_uploaded_files
|
113
|
+
define_api_method :import_group
|
114
|
+
define_api_method :import_question
|
115
|
+
define_api_method :import_survey
|
116
|
+
define_api_method :invite_participants
|
117
|
+
define_api_method :list_groups
|
118
|
+
define_api_method :list_participants
|
119
|
+
define_api_method :list_questions
|
120
|
+
define_api_method :list_surveys
|
121
|
+
define_api_method :list_users
|
122
|
+
define_api_method :mail_registered_participants
|
123
|
+
define_api_method :release_session_key
|
124
|
+
define_api_method :remind_participants
|
125
|
+
define_api_method :set_group_properties
|
126
|
+
define_api_method :set_language_properties
|
127
|
+
define_api_method :set_participant_properties
|
128
|
+
define_api_method :set_question_properties
|
129
|
+
define_api_method :set_quota_properties
|
130
|
+
define_api_method :set_survey_properties
|
131
|
+
define_api_method :update_response
|
132
|
+
define_api_method :upload_file
|
87
133
|
|
88
134
|
private
|
89
135
|
|
data/lib/limeade/version.rb
CHANGED
data/limeade.gemspec
CHANGED
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
36
36
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
37
|
spec.require_paths = ['lib']
|
38
38
|
|
39
|
-
spec.add_runtime_dependency 'faraday', '>= 0.12.0'
|
39
|
+
spec.add_runtime_dependency 'faraday', '>= 0.12.0', '< 2.0'
|
40
40
|
spec.add_runtime_dependency 'multi_json', '~> 1.13'
|
41
41
|
|
42
42
|
spec.add_development_dependency 'bundler', '>= 1.17', '< 3.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: limeade
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Pellegrini
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -17,6 +17,9 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 0.12.0
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.0'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -24,6 +27,9 @@ dependencies:
|
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
29
|
version: 0.12.0
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '2.0'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: multi_json
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,7 +116,6 @@ files:
|
|
110
116
|
- lib/limeade/client.rb
|
111
117
|
- lib/limeade/errors.rb
|
112
118
|
- lib/limeade/json_rpc.rb
|
113
|
-
- lib/limeade/methods.rb
|
114
119
|
- lib/limeade/version.rb
|
115
120
|
- limeade.gemspec
|
116
121
|
homepage: https://github.com/spokesoftware/limeade
|
@@ -119,11 +124,11 @@ licenses:
|
|
119
124
|
metadata:
|
120
125
|
allowed_push_host: https://rubygems.org
|
121
126
|
homepage_uri: https://github.com/spokesoftware/limeade
|
122
|
-
documentation_uri: https://www.rubydoc.info/gems/limeade/0.1.
|
127
|
+
documentation_uri: https://www.rubydoc.info/gems/limeade/0.1.3
|
123
128
|
bug_tracker_uri: https://github.com/spokesoftware/limeade/issues
|
124
129
|
source_code_uri: https://github.com/spokesoftware/limeade
|
125
130
|
changelog_uri: https://github.com/spokesoftware/limeade/releases
|
126
|
-
post_install_message:
|
131
|
+
post_install_message:
|
127
132
|
rdoc_options: []
|
128
133
|
require_paths:
|
129
134
|
- lib
|
@@ -138,9 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
143
|
- !ruby/object:Gem::Version
|
139
144
|
version: '0'
|
140
145
|
requirements: []
|
141
|
-
|
142
|
-
|
143
|
-
signing_key:
|
146
|
+
rubygems_version: 3.1.6
|
147
|
+
signing_key:
|
144
148
|
specification_version: 4
|
145
149
|
summary: A Ruby interface to the LimeSurvey API.
|
146
150
|
test_files: []
|
data/lib/limeade/methods.rb
DELETED
@@ -1,55 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Limeade
|
4
|
-
API_METHODS = <<~_API_METHODS
|
5
|
-
activate_survey
|
6
|
-
activate_tokens
|
7
|
-
add_group
|
8
|
-
add_language
|
9
|
-
add_participants
|
10
|
-
add_response
|
11
|
-
add_survey
|
12
|
-
copy_survey
|
13
|
-
cpd_importParticipants
|
14
|
-
delete_group
|
15
|
-
delete_language
|
16
|
-
delete_participants
|
17
|
-
delete_question
|
18
|
-
delete_survey
|
19
|
-
export_responses
|
20
|
-
export_responses_by_token
|
21
|
-
export_statistics
|
22
|
-
export_timeline
|
23
|
-
get_group_properties
|
24
|
-
get_language_properties
|
25
|
-
get_participant_properties
|
26
|
-
get_question_properties
|
27
|
-
get_response_ids
|
28
|
-
get_session_key
|
29
|
-
get_site_settings
|
30
|
-
get_summary
|
31
|
-
get_survey_properties
|
32
|
-
get_uploaded_files
|
33
|
-
import_group
|
34
|
-
import_question
|
35
|
-
import_survey
|
36
|
-
invite_participants
|
37
|
-
list_groups
|
38
|
-
list_participants
|
39
|
-
list_questions
|
40
|
-
list_surveys
|
41
|
-
list_users
|
42
|
-
mail_registered_participants
|
43
|
-
release_session_key
|
44
|
-
remind_participants
|
45
|
-
set_group_properties
|
46
|
-
set_language_properties
|
47
|
-
set_participant_properties
|
48
|
-
set_question_properties
|
49
|
-
set_quota_properties
|
50
|
-
set_survey_properties
|
51
|
-
update_response
|
52
|
-
upload_file
|
53
|
-
_API_METHODS
|
54
|
-
.split("\n").map(&:to_sym).freeze
|
55
|
-
end
|