omnievent 0.1.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 97d76b9c0d639b3c9dcf7f184c1f73560a6515ca25c18fab1d06a2131943cea3
4
+ data.tar.gz: 5ac02e7baf864326addcdb36260902cb3fcce9cee49d6f271721d5d4475eb005
5
+ SHA512:
6
+ metadata.gz: f27eb87c7ad6c19388d63291d535df003019f336754c8aba9a80af92963879afedab50d72488179d1941491b5086d6186d1c026bec91acaf15490909f9ba3542
7
+ data.tar.gz: 1bed4c1a11a8705604b97d65aefa6b5a2a3a165e8f55a96bf4cfee9335133aff4e00060f1e53f244a4f4a8a77216ed2a56807527e90173e096fa909fb2e2e0d3
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --format documentation
2
+ --color
3
+ --exclude-pattern vendor/**/*_spec.rb
4
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,48 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.6
3
+
4
+ Layout/LineLength:
5
+ Max: 120
6
+
7
+ Lint/ConstantDefinitionInBlock:
8
+ Exclude:
9
+ - 'spec/**/*.rb'
10
+
11
+ Metrics/BlockLength:
12
+ Exclude:
13
+ - 'omnievent.gemspec'
14
+ - 'spec/**/*.rb'
15
+
16
+ Metrics/MethodLength:
17
+ CountComments: false
18
+ Max: 25
19
+
20
+ Metrics/ClassLength:
21
+ Max: 150
22
+
23
+ Metrics/ParameterLists:
24
+ Max: 4
25
+ CountKeywordArgs: true
26
+
27
+ Metrics/AbcSize:
28
+ Enabled: false
29
+
30
+ Metrics/CyclomaticComplexity:
31
+ Enabled: false
32
+
33
+ Metrics/PerceivedComplexity:
34
+ Enabled: false
35
+
36
+ Style/StringLiterals:
37
+ Enabled: true
38
+ EnforcedStyle: double_quotes
39
+
40
+ Style/StringLiteralsInInterpolation:
41
+ Enabled: true
42
+ EnforcedStyle: double_quotes
43
+
44
+ Style/OptionalBooleanParameter:
45
+ Enabled: false
46
+
47
+ Style/MultilineBlockChain:
48
+ Enabled: false
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-06-13
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at angus@mcleod.org.au. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in omnievent.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
13
+
14
+ gem "timecop", "~> 0.9.5"
data/Gemfile.lock ADDED
@@ -0,0 +1,78 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ omnievent (0.1.0.pre1)
5
+ hashie (>= 3.4.6)
6
+ iso-639 (~> 0.3.5)
7
+ tzinfo (~> 2.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activesupport (7.0.3.1)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 1.6, < 2)
15
+ minitest (>= 5.1)
16
+ tzinfo (~> 2.0)
17
+ ast (2.4.2)
18
+ byebug (11.1.3)
19
+ concurrent-ruby (1.1.10)
20
+ diff-lcs (1.5.0)
21
+ hashie (5.0.0)
22
+ i18n (1.12.0)
23
+ concurrent-ruby (~> 1.0)
24
+ iso-639 (0.3.5)
25
+ json (2.6.2)
26
+ minitest (5.16.3)
27
+ parallel (1.22.1)
28
+ parser (3.1.2.1)
29
+ ast (~> 2.4.1)
30
+ rainbow (3.1.1)
31
+ rake (13.0.6)
32
+ regexp_parser (2.6.0)
33
+ rexml (3.2.5)
34
+ rspec (3.11.0)
35
+ rspec-core (~> 3.11.0)
36
+ rspec-expectations (~> 3.11.0)
37
+ rspec-mocks (~> 3.11.0)
38
+ rspec-core (3.11.0)
39
+ rspec-support (~> 3.11.0)
40
+ rspec-expectations (3.11.1)
41
+ diff-lcs (>= 1.2.0, < 2.0)
42
+ rspec-support (~> 3.11.0)
43
+ rspec-mocks (3.11.1)
44
+ diff-lcs (>= 1.2.0, < 2.0)
45
+ rspec-support (~> 3.11.0)
46
+ rspec-support (3.11.1)
47
+ rubocop (1.36.0)
48
+ json (~> 2.3)
49
+ parallel (~> 1.10)
50
+ parser (>= 3.1.2.1)
51
+ rainbow (>= 2.2.2, < 4.0)
52
+ regexp_parser (>= 1.8, < 3.0)
53
+ rexml (>= 3.2.5, < 4.0)
54
+ rubocop-ast (>= 1.20.1, < 2.0)
55
+ ruby-progressbar (~> 1.7)
56
+ unicode-display_width (>= 1.4.0, < 3.0)
57
+ rubocop-ast (1.21.0)
58
+ parser (>= 3.1.1.0)
59
+ ruby-progressbar (1.11.0)
60
+ timecop (0.9.5)
61
+ tzinfo (2.0.5)
62
+ concurrent-ruby (~> 1.0)
63
+ unicode-display_width (2.3.0)
64
+
65
+ PLATFORMS
66
+ ruby
67
+
68
+ DEPENDENCIES
69
+ activesupport (~> 7.0)
70
+ byebug
71
+ omnievent!
72
+ rake (~> 13.0)
73
+ rspec (~> 3.0)
74
+ rubocop (~> 1.21)
75
+ timecop (~> 0.9.5)
76
+
77
+ BUNDLED WITH
78
+ 2.3.14
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Angus McLeod
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,63 @@
1
+ # OmniEvent (In Development)
2
+
3
+ Manage events from any calendar, event discovery, event ticketing, event management, social network or video conferencing provider in ruby.
4
+
5
+ This gem is significantly inspired by, and structurally similar to, [OmniAuth](https://github.com/omniauth/omniauth). It is the result of research conducted by Pavilion in the [NGI DAPSI program](https://dapsi.ngi.eu/), specifically:
6
+
7
+ > A study of the existing calendar event standards, and attempts to develop a standard calendar event data model, including a comparative analysis of the current data models of popular event-related services.
8
+
9
+ The research and its associated data will be made publicly available in the coming months, along with code documentation (using YARD) and a product landing page.
10
+
11
+ ## Installation
12
+
13
+ The gem is still being developed and is not yet ready for installation. You can use it locally (see below).
14
+
15
+ ## Usage (development only)
16
+
17
+ Please note that the gem is still being developed and is not yet ready for production use.
18
+
19
+ ### Configure Providers
20
+
21
+ First, you need to configure at least one event provider strategy using the `OmniEvent::Builder`.
22
+ The gem comes packaged with the `developer` provider strategy, which merely demonstrates
23
+ the functionality, and does not connect to any real provider. All real provider
24
+ strategies will be packaged as separate gems, similar to the OmniAuth gem.
25
+
26
+ ```
27
+ OmniEvent::Builder.new do
28
+ provider :developer
29
+ end
30
+ ```
31
+
32
+ #### Authorization
33
+
34
+ Authorization is handled by each provider strategy according to the authorization
35
+ mechanisms of that provider. Check the provider gem's readme to see what options
36
+ need to be set during configuration to ensure your connection to the provider
37
+ is authorized.
38
+
39
+ ### Event Methods
40
+
41
+ OmniEvent has various event methods to provide access to events from one or more
42
+ of your configured providers. All event methods are available as class methods
43
+ on the `OmniEvent` module.
44
+
45
+ #### List Events (`list_events`)
46
+
47
+ List events from a configured provider.
48
+
49
+ ```
50
+ OmniEvent.list_events(:developer, opts)
51
+ ```
52
+
53
+ ##### Options
54
+
55
+ `from_time`: List events from time.
56
+
57
+ ## License
58
+
59
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
60
+
61
+ ## Code of Conduct
62
+
63
+ Everyone interacting in the Omnievent project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/paviliondev/omnievent/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ module OmniEvent
4
+ # Builds strategies for the current instance of OmniAuth
5
+ class Builder
6
+ def initialize(&block)
7
+ instance_eval(&block) if block_given?
8
+ end
9
+
10
+ # Configures the Builder.
11
+ def configure(&block)
12
+ OmniEvent.configure(&block)
13
+ end
14
+
15
+ # Allows arbitrary options to be passed to strategies.
16
+ def options(options = false)
17
+ return @options ||= {} if options == false
18
+
19
+ @options = options
20
+ end
21
+
22
+ # Registers a provider.
23
+ def provider(name, *args, **opts, &block)
24
+ klass = OmniEvent.provider_class(name)
25
+ raise MissingStrategy, "Could not find matching strategy for #{klass.inspect}." unless klass
26
+
27
+ unless OmniEvent.strategies.include?(klass)
28
+ raise StrategyNotIncluded, "Strategy for #{klass.inspect} has not been included properly."
29
+ end
30
+
31
+ OmniEvent.active_strategies[klass] = proc { klass.new(*args, **options.merge(opts), &block) }
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "singleton"
4
+
5
+ module OmniEvent
6
+ # Configuration class.
7
+ class Configuration
8
+ include Singleton
9
+
10
+ OPTIONS = %i[
11
+ logger
12
+ camelizations
13
+ ].freeze
14
+
15
+ attr_accessor :data
16
+
17
+ # :nodoc
18
+ def initialize
19
+ @data = {}
20
+ set_defaults
21
+ end
22
+
23
+ OPTIONS.each do |o|
24
+ define_method o do
25
+ @data[o]
26
+ end
27
+ define_method "#{o}=" do |value|
28
+ @data[o] = value
29
+ end
30
+ end
31
+
32
+ def configure(options)
33
+ Util.recursive_hash_merge(@data, options)
34
+ end
35
+
36
+ def set_defaults
37
+ @data[:logger] = ::OmniEvent.default_logger
38
+ @data[:camelizations] = {}
39
+ end
40
+
41
+ instance_eval(OPTIONS.map do |option|
42
+ o = option.to_s
43
+ <<-METHODS
44
+ def #{o}
45
+ instance.data[:#{o}]
46
+ end
47
+
48
+ def #{o}=(value)
49
+ instance.data[:#{o}] = value
50
+ end
51
+ METHODS
52
+ end.join("\n\n"))
53
+
54
+ def self.set_defaults
55
+ instance.set_defaults
56
+ end
57
+ end
58
+ end