adaline 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c725ce41edebea917ef57277e03b3e276f0aa8f587750bf7cd23e61e38889eb8
4
+ data.tar.gz: 37e9fdf3339fd2ba46f97fa1f1ca328475dbc69f8f8440d756b2fc1f5106227d
5
+ SHA512:
6
+ metadata.gz: 6fe220498206b51929f6588a81ea539ff16978a3fbdb889232a2e4c1af3973dff55891b4a32ab290cc69e0c073a172c586d8dbc210051e56c659d71e504bbbb3
7
+ data.tar.gz: d392240d7e7fe32bd37e2b81f2f56bf59785d2b1f861dc2b7bfa4d787b2f3845e8dcb9b217b848989644cf4b81384a51571b28b190e3388d43b5bb1da2d987fb
data/CHANGELOG.md ADDED
@@ -0,0 +1,21 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ ### Changed
13
+
14
+ ### Removed
15
+
16
+ ## [v0.0.1] - 2025-06-15
17
+
18
+ Initial release.
19
+
20
+ [unreleased]: https://github.com/floriandejonckheere/adaline/compare/v0.0.1..HEAD
21
+ [v0.0.1]: https://github.com/floriandejonckheere/adaline/releases/tags/v0.0.1
data/Gemfile ADDED
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in adaline.gemspec
6
+ gemspec
7
+
8
+ group :development, :test do
9
+ # Debugger
10
+ gem "debug", "1.10.0", require: false
11
+
12
+ # Build objects for tests
13
+ gem "factory_bot", "6.5.1", require: false
14
+
15
+ # Generate fake data
16
+ gem "ffaker", "2.24.0", require: false
17
+
18
+ # Task runner
19
+ gem "rake", "13.2.1", require: false
20
+
21
+ # Behavior-driven test framework
22
+ gem "rspec", "3.13.0", require: false
23
+
24
+ # Linter
25
+ gem "rubocop", "1.75.6", require: false
26
+ gem "rubocop-factory_bot", "2.27.1", require: false
27
+ gem "rubocop-performance", "1.25.0", require: false
28
+ gem "rubocop-rake", "0.7.1", require: false
29
+ gem "rubocop-rspec", "3.6.0", require: false
30
+
31
+ # Time control
32
+ gem "timecop", "0.9.10", require: false
33
+ end
data/LICENSE.md ADDED
@@ -0,0 +1,7 @@
1
+ Copyright 2025 Florian Dejonckheere
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Adaline
2
+ [![Continuous Integration](https://github.com/floriandejonckheere/adaline/actions/workflows/ci.yml/badge.svg)](https://github.com/floriandejonckheere/adaline/actions/workflows/ci.yml)
3
+ ![Release](https://img.shields.io/github/v/release/floriandejonckheere/adaline?label=Latest%20release)
4
+
5
+ Your timeless WhatsApp companion.
6
+
7
+ Adaline is your personal timekeeper that remembers everything, so you can concentrate on what matters most.
8
+ Communicate with Adaline through WhatsApp to set reminders, create tasks, and manage your schedule effortlessly.
9
+ Adaline will remind you what you need to know, when you need to know it.
10
+
11
+ ### Installation
12
+
13
+ Install Adaline as a Ruby gem:
14
+
15
+ $ gem install adaline
16
+
17
+ ### Configuration
18
+
19
+ Configure your credentials in `.env`, see `.example.env` for an example.
20
+
21
+ ### Usage
22
+
23
+ To use Adaline, start the server:
24
+
25
+ ```sh
26
+ adaline start
27
+ ```
28
+
29
+ ## Testing
30
+
31
+ ```ssh
32
+ # Run test suite
33
+ bundle exec rspec
34
+ ```
35
+
36
+ ## Releasing
37
+
38
+ To release a new version, update the version number in `lib/adaline/version.rb`, update the changelog, commit the files and create a git tag starting with `v`, and push it to the repository.
39
+ Github Actions will automatically run the test suite, build the `.gem` file and push it to [rubygems.org](https://rubygems.org).
40
+
41
+ ## Contributing
42
+
43
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/floriandejonckheere/adaline](https://github.com/floriandejonckheere/adaline).
44
+
45
+ ## License
46
+
47
+ The software is available as open source under the terms of the [MIT License](LICENSE.md).
data/bin/adaline ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+
6
+ require "adaline"
7
+
8
+ Adaline::CLI.start(ARGV)
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ Adaline.loader.inflector.inflect({
4
+ "cli" => "CLI",
5
+ })
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "whatsapp_sdk"
4
+
5
+ WhatsappSdk.configure do |config|
6
+ config.access_token = ENV.fetch("ACCESS_TOKEN")
7
+ end
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "thor"
4
+
5
+ module Adaline
6
+ # Adaline includes a command-line interface (CLI) to manage queues and messages
7
+ #
8
+ # After installing Adaline, run +adaline+ to see the available commands.
9
+ #
10
+ # $ adaline
11
+ # Commands:
12
+ # adaline help [COMMAND] # Describe available commands or one specific command
13
+ # adaline start # Start server
14
+ # adaline version # Display version
15
+ #
16
+ # To see the available options for a command, run +adaline help COMMAND+.
17
+ #
18
+ class CLI < Thor
19
+ def self.exit_on_failure?
20
+ true
21
+ end
22
+
23
+ desc "start", "Start server"
24
+ def start
25
+ Commands::Start
26
+ .new(options)
27
+ .call
28
+ end
29
+
30
+ desc "version", "Display version"
31
+ def version
32
+ Commands::Version
33
+ .new(options)
34
+ .call
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Adaline
4
+ module Commands
5
+ class Base
6
+ attr_reader :options
7
+
8
+ def initialize(options = {})
9
+ @options = options
10
+ end
11
+
12
+ def call
13
+ validate
14
+ execute
15
+ rescue StandardError => e
16
+ puts e.message
17
+ end
18
+
19
+ protected
20
+
21
+ def validate
22
+ raise NotImplementedError
23
+ end
24
+
25
+ def execute
26
+ raise NotImplementedError
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Adaline
4
+ module Commands
5
+ class Start < Base
6
+ def validate; end
7
+
8
+ def execute
9
+ Rackup::Handler::WEBrick.run(
10
+ Adaline::Server,
11
+ Host: "127.0.0.1",
12
+ Port: 3000,
13
+ )
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Adaline
4
+ module Commands
5
+ class Version < Base
6
+ def validate; end
7
+
8
+ def execute
9
+ puts "Adaline #{Adaline::VERSION}"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # typed: true
4
+
5
+ require "logger"
6
+
7
+ module Adaline
8
+ # Adaline configuration
9
+ class Configuration
10
+ # Logger instance
11
+ def logger
12
+ @logger ||= Logger.new($stdout)
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Adaline
4
+ # Base error class
5
+ #
6
+ class Error < StandardError
7
+ end
8
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Adaline
4
+ class Server < Sinatra::Base
5
+ get "/" do
6
+ "Welcome to Adaline Server!"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Adaline
4
+ module Version
5
+ MAJOR = 0
6
+ MINOR = 0
7
+ PATCH = 1
8
+ PRE = nil
9
+
10
+ VERSION = [MAJOR, MINOR, PATCH].compact.join(".")
11
+
12
+ STRING = [VERSION, PRE].compact.join("-")
13
+ end
14
+
15
+ VERSION = Version::STRING
16
+ end
data/lib/adaline.rb ADDED
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # typed: true
4
+
5
+ require "forwardable"
6
+ require "pathname"
7
+
8
+ require "dotenv/load"
9
+ require "rackup/handler"
10
+ require "sinatra/base"
11
+ require "zeitwerk"
12
+
13
+ module Adaline
14
+ class << self
15
+ extend Forwardable
16
+
17
+ # Code loader instance
18
+ attr_reader :loader
19
+
20
+ # Global configuration
21
+ def configuration
22
+ @configuration ||= Configuration.new
23
+ end
24
+
25
+ def root
26
+ @root ||= Pathname.new(File.expand_path(File.join("..", ".."), __FILE__))
27
+ end
28
+
29
+ def setup
30
+ @loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
31
+
32
+ # Register inflections
33
+ require root.join("config/inflections.rb")
34
+
35
+ # Load initializers
36
+ Dir[root.join("config", "initializers", "*.rb")].each { |f| require f }
37
+
38
+ # Collapse concerns directory
39
+ loader.collapse(root.join("lib/adaline/concerns"))
40
+
41
+ loader.setup
42
+ loader.eager_load
43
+ end
44
+
45
+ def configure
46
+ yield configuration
47
+ end
48
+
49
+ def_delegator :configuration, :logger
50
+ end
51
+ end
52
+
53
+ Adaline.setup
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: adaline
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Florian Dejonckheere
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2025-06-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dotenv
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rackup
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '2.2'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '2.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: sinatra
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '4.1'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '4.1'
55
+ - !ruby/object:Gem::Dependency
56
+ name: thor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: webrick
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.9'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.9'
83
+ - !ruby/object:Gem::Dependency
84
+ name: whatsapp_sdk
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '1.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: zeitwerk
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.7'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.7'
111
+ description: Adaline is your personal timekeeper that remembers everything, so you
112
+ can concentrate on what matters most.
113
+ email:
114
+ - florian@floriandejonckheere.be
115
+ executables:
116
+ - adaline
117
+ extensions: []
118
+ extra_rdoc_files: []
119
+ files:
120
+ - CHANGELOG.md
121
+ - Gemfile
122
+ - LICENSE.md
123
+ - README.md
124
+ - bin/adaline
125
+ - config/inflections.rb
126
+ - config/initializers/whatsapp_sdk.rb
127
+ - lib/adaline.rb
128
+ - lib/adaline/cli.rb
129
+ - lib/adaline/commands/base.rb
130
+ - lib/adaline/commands/start.rb
131
+ - lib/adaline/commands/version.rb
132
+ - lib/adaline/configuration.rb
133
+ - lib/adaline/error.rb
134
+ - lib/adaline/server.rb
135
+ - lib/adaline/version.rb
136
+ homepage: https://github.com/floriandejonckheere/adaline
137
+ licenses:
138
+ - MIT
139
+ metadata:
140
+ source_code_uri: https://github.com/floriandejonckheere/adaline.git
141
+ rubygems_mfa_required: 'true'
142
+ post_install_message:
143
+ rdoc_options: []
144
+ require_paths:
145
+ - lib
146
+ required_ruby_version: !ruby/object:Gem::Requirement
147
+ requirements:
148
+ - - ">="
149
+ - !ruby/object:Gem::Version
150
+ version: '3.4'
151
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ requirements: []
157
+ rubygems_version: 3.4.20
158
+ signing_key:
159
+ specification_version: 4
160
+ summary: Your timeless WhatsApp companion
161
+ test_files: []