sowprog 0.0.2
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 +7 -0
- data/lib/sowprog.rb +36 -0
- metadata +45 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 05e70e3fe90a5c2af60e856b86e32fe7e1dcae638ded955949717a373ab7660d
|
4
|
+
data.tar.gz: d914d294488d94597593c34bd2c336753339c52f4425b36a6b236a4aa4f8d537
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f1722d5a604a9ce7b645747078fa105c68a76c103fcf0dfbd049356c44ae0c38aaa75c3336aa33b830866adf7c5452df67783021f2745732b03f3ea919bd3374
|
7
|
+
data.tar.gz: 5f3c90ac128ba4f2f470237ea3233ce6355a0cad7f0d243ea2914a521ba65911557a351878f0c63188b96774aa3d79cb8257362a39289a39f61cdd69bb60a2d2
|
data/lib/sowprog.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'net/http'
|
3
|
+
require 'base64'
|
4
|
+
require 'json'
|
5
|
+
# require 'sowprog/configuration'
|
6
|
+
|
7
|
+
class Sowprog
|
8
|
+
class Configuration
|
9
|
+
attr_accessor :user_name, :password
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.scheduled_events
|
13
|
+
url = URI('https://agenda.sowprog.com/rest/v1_2/scheduledEvents/search')
|
14
|
+
request = Net::HTTP::Get.new(url)
|
15
|
+
request["Accept"] = "application/json"
|
16
|
+
request["Content-Type"] = "application/json"
|
17
|
+
request["Authorization"] = "Basic " + Base64.encode64("#{Sowprog.configuration.user_name}:#{Sowprog.configuration.password}").strip
|
18
|
+
http = Net::HTTP.new(url.host, url.port)
|
19
|
+
http.use_ssl = true
|
20
|
+
response = http.request request
|
21
|
+
return JSON.parse(response.body)
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
def self.configuration
|
26
|
+
@configuration ||= Configuration.new
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.configure(&block)
|
30
|
+
yield(configuration)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
# Sowprog::ScheduledEvents.fetch
|
36
|
+
# Sowprog.scheduled_events
|
metadata
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sowprog
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- LiveTonight
|
8
|
+
- Guillaume Blanchard
|
9
|
+
- Hugo How-Choong
|
10
|
+
autorequire:
|
11
|
+
bindir: bin
|
12
|
+
cert_chain: []
|
13
|
+
date: 2022-09-09 00:00:00.000000000 Z
|
14
|
+
dependencies: []
|
15
|
+
description: SowProg Api for Ruby
|
16
|
+
email: hugo@livetonight.fr
|
17
|
+
executables: []
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- lib/sowprog.rb
|
22
|
+
homepage: https://rubygems.org/gems/sowprog-api-ruby
|
23
|
+
licenses:
|
24
|
+
- MIT
|
25
|
+
metadata: {}
|
26
|
+
post_install_message:
|
27
|
+
rdoc_options: []
|
28
|
+
require_paths:
|
29
|
+
- lib
|
30
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
requirements: []
|
41
|
+
rubygems_version: 3.1.6
|
42
|
+
signing_key:
|
43
|
+
specification_version: 4
|
44
|
+
summary: SowProg
|
45
|
+
test_files: []
|