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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccb54c0bd6edab1981311801e3abedc70f2b446f
4
- data.tar.gz: 1ea771c5578999270aad1565ed63ed6f7601140e
3
+ metadata.gz: 8f3621bfc3d9958997591232be27841baa4caeaa
4
+ data.tar.gz: 802b7ee594b2d553466ff9fc31dbf7cb7b3c6e21
5
5
  SHA512:
6
- metadata.gz: d20c73c185587aa8fcea427d828a2b69e79eedac718e65f623a684a3f21c86b8f099f2194a589b2688e596b8bddcc95e7a3fd78ef96aae27b13f18c8a723d2c9
7
- data.tar.gz: fb97f3ac8e069a05fd4789d8d548413b781323e021efeb55aa766291c0c72894ce9544561b11cf97e84c1c170ee91f223b131561435bbd52c947e056e9937918
6
+ metadata.gz: ef293197430f1e5ca0e7da0573d99be8e17ada972aa0b49488a17ef5af2c7605ef6609f3b7819ec705d906b1424b2ca0530a15668f022cbbcf2842a2b697de5a
7
+ data.tar.gz: 35ae67680846a5468e1dadcccd6e1803a155de8699ff50ff8dbd16daad17834d94080f1d93e66a6fac621533451a77f052d7688833f84f464ff696a35fc487c5
data/lib/reminder.rb CHANGED
@@ -8,8 +8,6 @@ require "reminder/player/adapters/spotify"
8
8
  require "reminder/notifier/base"
9
9
  require "reminder/notifier/adapters/say"
10
10
 
11
- require 'byebug'
12
-
13
11
  module Reminder
14
12
  class Runner
15
13
  include Demonizer
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
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
@@ -1,8 +0,0 @@
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
@@ -1,6 +0,0 @@
1
- module Demonizer
2
- def demonize(process)
3
- process.daemon(true, true)
4
- yield
5
- end
6
- end
@@ -1,11 +0,0 @@
1
- module Notifier
2
- module Adapters
3
- module Say
4
- class << self
5
- def run(message)
6
- `say "#{message}"`
7
- end
8
- end
9
- end
10
- end
11
- end
@@ -1,19 +0,0 @@
1
- module Notifier
2
- class Base
3
- class << self
4
- def init
5
- self.tap { @adapter = adapter }
6
- end
7
-
8
- def run(message)
9
- @adapter.run(message)
10
- end
11
-
12
- private
13
-
14
- def adapter
15
- Adapters::Say
16
- end
17
- end
18
- end
19
- end
@@ -1,7 +0,0 @@
1
- class Notifier
2
- class << self
3
- def run(message)
4
- `say "#{message}"`
5
- end
6
- end
7
- end
@@ -1,7 +0,0 @@
1
- require 'sucker_punch'
2
-
3
- module Performer
4
- class Base
5
- include SuckerPunch::Job
6
- end
7
- end
@@ -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
@@ -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
@@ -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
@@ -1,3 +0,0 @@
1
- module Reminder
2
- VERSION = "0.1.4"
3
- end
@@ -1,11 +0,0 @@
1
- require "spec_helper"
2
-
3
- RSpec.describe Reminder do
4
- it "has a version number" do
5
- expect(Reminder::VERSION).not_to be nil
6
- end
7
-
8
- it "does something useful" do
9
- expect(false).to eq(true)
10
- end
11
- end
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