remindice 0.1.2

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: d4cf1a58fc32d01333c2bd98ea597b2d4e0eef00
4
+ data.tar.gz: cfbd446126899a0d75572f2ad099bf55a6a0fbf9
5
+ SHA512:
6
+ metadata.gz: 582ad9f6ec7337698857a42a1367c245e8ca9902ca1a780371b9f65114ca29b6b079aa1e122d8489d8b1f336f023eff8094740dd7c706dfef182600ff559f8b0
7
+ data.tar.gz: afddc344d0a3e421cf7f2cbf99e95482e4f883164834f60d6dd81d3e06b0657404490a7b513ba8b8f88463f76a823a9c32194f3a54c3cfa13cb1a4105c6fec2b
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in remindice.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Roadagain
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 all
13
+ 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 THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Remindice
2
+
3
+ This gem is a simple reminder.
4
+ You can add, remove, and list tasks.
5
+ If you want, you can roll the dice and choose a task to do.
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'remindice'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install remindice
22
+
23
+ ## Usage
24
+
25
+ ```
26
+ $ remindice add "write reports" "attend a programming contest"
27
+ $ remindice remove "throw up a tooth"
28
+ $ remindice clear # You can also use `remove` with `--all` or `-a` instead of this
29
+ $ remindice list
30
+ $ remindice roll
31
+ ```
32
+
33
+ ## Development
34
+
35
+ 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).
36
+
37
+ ## Contributing
38
+
39
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Roadagain/remindice.
40
+
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+ task :default => :spec
data/bin/remindice ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "remindice"
4
+
5
+ Remindice::Commands.start
data/lib/remindice.rb ADDED
@@ -0,0 +1,76 @@
1
+ require "remindice/version"
2
+ require "thor"
3
+
4
+ module Remindice
5
+ TASK_FILENAME = File.expand_path("~/.remindice_tasks")
6
+
7
+ class << self
8
+ def tasks
9
+ @@tasks.clone
10
+ end
11
+
12
+ def save(tasks)
13
+ file = File.open(TASK_FILENAME, "w")
14
+ tasks.each do |i|
15
+ file.puts i
16
+ end
17
+ end
18
+ end
19
+ class Commands < Thor
20
+ if File.exists?(Remindice::TASK_FILENAME)
21
+ @@tasks = File.readlines(Remindice::TASK_FILENAME).map{|i| i.chomp}
22
+ else
23
+ @@tasks = []
24
+ end
25
+
26
+ desc 'add TASKS', 'Add tasks'
27
+ def add(*task)
28
+ task.each do |i|
29
+ if @@tasks.include? i
30
+ STDERR.puts "'#{i}' is already added"
31
+ else
32
+ @@tasks << i
33
+ puts "'#{i}' is successfully added"
34
+ end
35
+ end
36
+ Remindice.save @@tasks
37
+ end
38
+
39
+ option :all, :type => :boolean, :aliases => :a
40
+ desc 'remove TASKS', 'Remove tasks'
41
+ def remove(*task)
42
+ if options[:all]
43
+ clear
44
+ return
45
+ else
46
+ task.each do |i|
47
+ if @@tasks.include? i
48
+ @@tasks.delete i
49
+ puts "'#{i}' is successfully removed"
50
+ else
51
+ STDERR.puts "'#{i}' does not exist"
52
+ end
53
+ end
54
+ Remindice.save @@tasks
55
+ end
56
+ end
57
+
58
+ desc 'clear', 'Clear tasks'
59
+ def clear
60
+ Remindice.save []
61
+ puts "Tasks are successfully cleared"
62
+ end
63
+
64
+ desc 'list', 'List tasks'
65
+ def list
66
+ @@tasks.each do |i|
67
+ puts i
68
+ end
69
+ end
70
+
71
+ desc 'roll', 'Choose a task randomly'
72
+ def roll
73
+ puts @@tasks.sample
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,3 @@
1
+ module Remindice
2
+ VERSION = "0.1.2"
3
+ end
data/remindice.gemspec ADDED
@@ -0,0 +1,32 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'remindice/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "remindice"
8
+ spec.version = Remindice::VERSION
9
+ spec.authors = ["Roadagain"]
10
+ spec.email = ["ringoh72@gmail.com"]
11
+
12
+ spec.summary = %q{The reminder chooses tasks randomly}
13
+ # spec.description = %q{TODO: Write a longer description or delete this line.}
14
+ spec.homepage = "https://github.com/Roadagain/remindice"
15
+
16
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
17
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
18
+ # if spec.respond_to?(:metadata)
19
+ # spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
20
+ # else
21
+ # raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ # end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.bindir = "bin"
26
+ spec.executables = "remindice"
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_development_dependency "bundler", "~> 1.12"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_dependency "thor", "~> 0.19.1"
32
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: remindice
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Roadagain
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-07-05 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.12'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.12'
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: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 0.19.1
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 0.19.1
55
+ description:
56
+ email:
57
+ - ringoh72@gmail.com
58
+ executables:
59
+ - remindice
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - Gemfile
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
68
+ - bin/remindice
69
+ - lib/remindice.rb
70
+ - lib/remindice/version.rb
71
+ - remindice.gemspec
72
+ homepage: https://github.com/Roadagain/remindice
73
+ licenses: []
74
+ metadata: {}
75
+ post_install_message:
76
+ rdoc_options: []
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ requirements: []
90
+ rubyforge_project:
91
+ rubygems_version: 2.6.6
92
+ signing_key:
93
+ specification_version: 4
94
+ summary: The reminder chooses tasks randomly
95
+ test_files: []
96
+ has_rdoc: