remme 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/reminder.rb +0 -2
- metadata +1 -29
- data/README.md +0 -41
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/lib/reminder/demonizer.rb +0 -6
- data/lib/reminder/notifier/adapters/say.rb +0 -11
- data/lib/reminder/notifier/base.rb +0 -19
- data/lib/reminder/notifier.rb +0 -7
- data/lib/reminder/performer/base.rb +0 -7
- data/lib/reminder/player/adapters/spotify.rb +0 -33
- data/lib/reminder/player/base.rb +0 -30
- data/lib/reminder/scheduler.rb +0 -51
- data/lib/reminder/version.rb +0 -3
- data/spec/reminder_spec.rb +0 -11
- data/spec/spec_helper.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f3621bfc3d9958997591232be27841baa4caeaa
|
4
|
+
data.tar.gz: 802b7ee594b2d553466ff9fc31dbf7cb7b3c6e21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef293197430f1e5ca0e7da0573d99be8e17ada972aa0b49488a17ef5af2c7605ef6609f3b7819ec705d906b1424b2ca0530a15668f022cbbcf2842a2b697de5a
|
7
|
+
data.tar.gz: 35ae67680846a5468e1dadcccd6e1803a155de8699ff50ff8dbd16daad17834d94080f1d93e66a6fac621533451a77f052d7688833f84f464ff696a35fc487c5
|
data/lib/reminder.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remme
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luis Vasconcellos
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '3.0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: byebug
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '9.0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '9.0'
|
83
69
|
description:
|
84
70
|
email:
|
85
71
|
- luis@luisvasconcellos.com
|
@@ -88,22 +74,8 @@ executables:
|
|
88
74
|
extensions: []
|
89
75
|
extra_rdoc_files: []
|
90
76
|
files:
|
91
|
-
- README.md
|
92
|
-
- bin/console
|
93
77
|
- bin/remme
|
94
|
-
- bin/setup
|
95
78
|
- lib/reminder.rb
|
96
|
-
- lib/reminder/demonizer.rb
|
97
|
-
- lib/reminder/notifier.rb
|
98
|
-
- lib/reminder/notifier/adapters/say.rb
|
99
|
-
- lib/reminder/notifier/base.rb
|
100
|
-
- lib/reminder/performer/base.rb
|
101
|
-
- lib/reminder/player/adapters/spotify.rb
|
102
|
-
- lib/reminder/player/base.rb
|
103
|
-
- lib/reminder/scheduler.rb
|
104
|
-
- lib/reminder/version.rb
|
105
|
-
- spec/reminder_spec.rb
|
106
|
-
- spec/spec_helper.rb
|
107
79
|
homepage: http://luisvasconcellos.com
|
108
80
|
licenses:
|
109
81
|
- MIT
|
data/README.md
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# Reminder
|
2
|
-
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/reminder`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
|
-
## Installation
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'reminder'
|
13
|
-
```
|
14
|
-
|
15
|
-
And then execute:
|
16
|
-
|
17
|
-
$ bundle
|
18
|
-
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install reminder
|
22
|
-
|
23
|
-
## Usage
|
24
|
-
|
25
|
-
TODO: Write usage instructions here
|
26
|
-
|
27
|
-
## Development
|
28
|
-
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
-
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
-
|
33
|
-
## Contributing
|
34
|
-
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/Luis Vasconcellos/reminder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
36
|
-
|
37
|
-
|
38
|
-
## License
|
39
|
-
|
40
|
-
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
-
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "reminder"
|
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
DELETED
data/lib/reminder/demonizer.rb
DELETED
data/lib/reminder/notifier.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
module Player
|
2
|
-
module Adapters
|
3
|
-
module Spotify
|
4
|
-
class << self
|
5
|
-
def play
|
6
|
-
`osascript -e 'tell application "Spotify" to play'`
|
7
|
-
end
|
8
|
-
|
9
|
-
def pause
|
10
|
-
`osascript -e 'tell application "Spotify" to pause'`
|
11
|
-
end
|
12
|
-
|
13
|
-
def being_played?
|
14
|
-
script = %q{
|
15
|
-
echo $(osascript <<EOF
|
16
|
-
set state to missing value
|
17
|
-
|
18
|
-
if application "Spotify" is running then
|
19
|
-
tell application "Spotify"
|
20
|
-
set state to (player state as text)
|
21
|
-
end tell
|
22
|
-
end if
|
23
|
-
|
24
|
-
return state is equal to "playing"
|
25
|
-
EOF)
|
26
|
-
}
|
27
|
-
|
28
|
-
`#{script}`.strip == 'true'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/lib/reminder/player/base.rb
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'byebug'
|
2
|
-
|
3
|
-
module Player
|
4
|
-
class Base
|
5
|
-
class << self
|
6
|
-
def init
|
7
|
-
self.tap do
|
8
|
-
@adapter = adapter
|
9
|
-
@was_playing = adapter.being_played?
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def pause
|
14
|
-
return if !@was_playing
|
15
|
-
@adapter.pause
|
16
|
-
end
|
17
|
-
|
18
|
-
def play
|
19
|
-
return if !@was_playing
|
20
|
-
@adapter.play
|
21
|
-
end
|
22
|
-
|
23
|
-
private
|
24
|
-
|
25
|
-
def adapter
|
26
|
-
Adapters::Spotify
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
data/lib/reminder/scheduler.rb
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
require 'reminder/performer/base'
|
2
|
-
|
3
|
-
class Scheduler < Performer::Base
|
4
|
-
class << self
|
5
|
-
attr_accessor :completed
|
6
|
-
alias :completed? :completed
|
7
|
-
|
8
|
-
@@class_instance_fields = %i(
|
9
|
-
after_hook before_hook
|
10
|
-
message notifier
|
11
|
-
)
|
12
|
-
|
13
|
-
def run(options)
|
14
|
-
build_class_instance_fields(options)
|
15
|
-
perform_in(options.delete(:timeout))
|
16
|
-
end
|
17
|
-
|
18
|
-
@@class_instance_fields.each do |field|
|
19
|
-
define_method(field) { instance_variable_get("@#{field}") }
|
20
|
-
end
|
21
|
-
|
22
|
-
def build_class_instance_fields(options)
|
23
|
-
@@class_instance_fields.each do |field_name|
|
24
|
-
instance_variable_set("@#{field_name}", options.delete(field_name))
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
def perform
|
30
|
-
complete_after { notify }
|
31
|
-
end
|
32
|
-
|
33
|
-
private
|
34
|
-
|
35
|
-
def notify
|
36
|
-
with_callbacks do
|
37
|
-
self.class.notifier.run(self.class.message)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def complete_after
|
42
|
-
yield
|
43
|
-
self.class.completed = true
|
44
|
-
end
|
45
|
-
|
46
|
-
def with_callbacks
|
47
|
-
self.class.before_hook.call
|
48
|
-
yield
|
49
|
-
self.class.after_hook.call
|
50
|
-
end
|
51
|
-
end
|
data/lib/reminder/version.rb
DELETED
data/spec/reminder_spec.rb
DELETED
data/spec/spec_helper.rb
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
require "bundler/setup"
|
2
|
-
require "reminder"
|
3
|
-
|
4
|
-
RSpec.configure do |config|
|
5
|
-
# Enable flags like --only-failures and --next-failure
|
6
|
-
config.example_status_persistence_file_path = ".rspec_status"
|
7
|
-
|
8
|
-
config.expect_with :rspec do |c|
|
9
|
-
c.syntax = :expect
|
10
|
-
end
|
11
|
-
end
|