slackdo 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8d19aa40d9a3d92511f4f5ddb68345f25f940c32
4
+ data.tar.gz: 32e1a229086c90826de5c2364a2ce6cfca1ada3c
5
+ SHA512:
6
+ metadata.gz: f63ee422d689ca0d2749777cb2093c37c9cc263bbf4f9f34c26345f90655c7cf6b51e1b63829cf3d9b9e1470659c393b788344f8a95e97cc0c1031b2106b33c0
7
+ data.tar.gz: 82f86ffd0c3351c5570c634a855ebe870f092d345e886780b77e7988e69c84300de4d06b3c5a53500681ad9638322656ae3e25505f5f21446677581172525e0b
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.2
5
+ before_install: gem install bundler -v 1.16.0
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in slackdo.gemspec
6
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,39 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ slackdo (0.1.0)
5
+ highline
6
+ slack-notifier
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ diff-lcs (1.3)
12
+ highline (1.7.8)
13
+ rake (10.5.0)
14
+ rspec (3.7.0)
15
+ rspec-core (~> 3.7.0)
16
+ rspec-expectations (~> 3.7.0)
17
+ rspec-mocks (~> 3.7.0)
18
+ rspec-core (3.7.0)
19
+ rspec-support (~> 3.7.0)
20
+ rspec-expectations (3.7.0)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.7.0)
23
+ rspec-mocks (3.7.0)
24
+ diff-lcs (>= 1.2.0, < 2.0)
25
+ rspec-support (~> 3.7.0)
26
+ rspec-support (3.7.0)
27
+ slack-notifier (2.3.1)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ bundler (~> 1.16)
34
+ rake (~> 10.0)
35
+ rspec (~> 3.0)
36
+ slackdo!
37
+
38
+ BUNDLED WITH
39
+ 1.16.0
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 segersniels
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,26 @@
1
+ # Slackdo
2
+ SlackDO is a simple CLI tool that allows you to send TODO items and Reminders to yourself on Slack through an incoming webhook.
3
+
4
+ ## Installation
5
+
6
+ ```ruby
7
+ gem install slackdo
8
+ ```
9
+
10
+ ## Usage
11
+
12
+ First thing you should do is configure your incoming webhook by doing `slackdo webhook`.
13
+
14
+ After that you're all set to go. Add a new TODO item by typing `slackdo task` or add a reminder with `slackdo reminder`.
15
+
16
+ ## Development
17
+
18
+ Slackdo is still under development and might still be buggy. Feel free to add support to the project.
19
+
20
+ ## Contributing
21
+
22
+ Bug reports and pull requests are welcome on GitHub at https://github.com/segersniels/slackdo.
23
+
24
+ ## License
25
+
26
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "test"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/bin/slackdo ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'slackdo'
4
+
5
+ webhook = Slackdo::Webhook.new
6
+ webhook.create_directory
7
+
8
+ case ARGV[0]
9
+ when 'webhook'
10
+ webhook.configure_webhook
11
+ when 'task'
12
+ slack = Slackdo::Task.new
13
+ slack.add_task
14
+ when 'reminder'
15
+ slack = Slackdo::Reminder.new
16
+ slack.add_reminder
17
+ end
@@ -0,0 +1,3 @@
1
+ module Slackdo
2
+ VERSION = "0.1.0"
3
+ end
data/lib/slackdo.rb ADDED
@@ -0,0 +1,47 @@
1
+ require "slackdo/version"
2
+ require 'highline'
3
+ require 'slack-notifier'
4
+
5
+ module Slackdo
6
+ class Webhook
7
+ def create_directory
8
+ system 'mkdir ~/.slackdo'
9
+ end
10
+ def configure_webhook
11
+ cli = HighLine.new
12
+ webhook = cli.ask 'Configure your webhook:'
13
+ system "echo #{webhook} > ~/.slackdo/webhook"
14
+ end
15
+ end
16
+ class Task
17
+ def add_task
18
+ notifier = Slack::Notifier.new `cat ~/.slackdo/webhook`.strip
19
+ cli = HighLine.new
20
+ category = cli.ask 'What is the category of this new task? eg. DEV or GENERAL'
21
+ message = cli.ask 'Type your new task:'
22
+ want_note = cli.ask 'Do you want to add a note to this new task? y/n'
23
+ note_content = ''
24
+ while want_note == 'y'
25
+ note_text = cli.ask 'Type your note:'
26
+ note_content << "\n`- #{note_text}`"
27
+ want_note = cli.ask 'Do you want to add another note to the task? y/n'
28
+ end
29
+ note = {
30
+ fallback: "This should've been a new note but looks like something went wrong...",
31
+ text: note_content,
32
+ color: "gray",
33
+ mrkdwn_in: ["text"]
34
+ }
35
+ notifier.post text: "• [#{category}] #{message}", attachments: [note]
36
+ end
37
+ end
38
+
39
+ class Reminder
40
+ def add_reminder
41
+ notifier = Slack::Notifier.new `cat ~/.slackdo/webhook`.strip
42
+ cli = HighLine.new
43
+ message = cli.ask 'Type your reminder:'
44
+ notifier.post text: "◊ [REMINDER] #{message}"
45
+ end
46
+ end
47
+ end
data/slackdo.gemspec ADDED
@@ -0,0 +1,32 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "slackdo/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "slackdo"
8
+ spec.version = Slackdo::VERSION
9
+ spec.authors = ["segersniels"]
10
+ spec.email = ["segers.n@hotmail.com"]
11
+
12
+ spec.summary = %q{Send todo tasks and reminders to yourself on Slack.}
13
+ spec.description = %q{SlackDO provides you with an easy CLI tool which allows you to write todo tasks and reminders to yourself on Slack}
14
+ spec.homepage = ""
15
+ spec.license = "MIT"
16
+
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+
20
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
21
+ f.match(%r{^(test|spec|features)/})
22
+ end
23
+
24
+ spec.bindir = "exe"
25
+ spec.require_paths = ["lib"]
26
+
27
+ spec.add_development_dependency "bundler", "~> 1.16"
28
+ spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "rspec", "~> 3.0"
30
+ spec.add_dependency "highline"
31
+ spec.add_dependency "slack-notifier"
32
+ end
metadata ADDED
@@ -0,0 +1,129 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: slackdo
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - segersniels
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-11-03 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: highline
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: slack-notifier
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description: SlackDO provides you with an easy CLI tool which allows you to write
84
+ todo tasks and reminders to yourself on Slack
85
+ email:
86
+ - segers.n@hotmail.com
87
+ executables: []
88
+ extensions: []
89
+ extra_rdoc_files: []
90
+ files:
91
+ - ".gitignore"
92
+ - ".rspec"
93
+ - ".travis.yml"
94
+ - Gemfile
95
+ - Gemfile.lock
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
99
+ - bin/console
100
+ - bin/setup
101
+ - bin/slackdo
102
+ - lib/slackdo.rb
103
+ - lib/slackdo/version.rb
104
+ - slackdo.gemspec
105
+ homepage: ''
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubyforge_project:
125
+ rubygems_version: 2.6.14
126
+ signing_key:
127
+ specification_version: 4
128
+ summary: Send todo tasks and reminders to yourself on Slack.
129
+ test_files: []