macbot 0.1.3 → 0.1.4

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: 29689ea45d4761c102cd780670100ec1ec28b5bb
4
- data.tar.gz: f803acc1edd89e031551d90b18b6e74312b83bc0
3
+ metadata.gz: d9007bf94c0644e60213ac6e69fa591a92347a6b
4
+ data.tar.gz: b4739018549c978eda3741e89885c2023248687b
5
5
  SHA512:
6
- metadata.gz: 664b9559471b608bdb088f65fa5912cf7c05ba60e3d489d9f8a7f33ad658bde0c7887e3e2cf01264cf711622a34090152fb5c5a833e0af063f67a6665a0a9ccf
7
- data.tar.gz: 7f67484c32779cd36a30047b59a2b6419e485e17efff8daa6e247136f554cf34db67255b524a0786923e623b512b86ff2c5577d7dec023d157791fc277683921
6
+ metadata.gz: 95825406f0feb198c71b1f601a3ee05d36598cf108cc0816892a8be04a0ad67ec93a0e813e8311ceadee8ad6e0d94fedfc5f68733d669ed850ea52b48f7bcc8c
7
+ data.tar.gz: ffd081aaf793a230d011617e3ff80f5d1fb8eb9bb724dd09f0fbbbeb4349e419fc93d9b4f88c1e90da8c8156a86ef555fad4f7142ad78daea858ba7ce4cf61f1
data/README.md CHANGED
@@ -1,34 +1,67 @@
1
1
  # Macbot
2
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/macbot`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [![Gem Version](https://badge.fury.io/rb/macbot.svg)](http://badge.fury.io/rb/macbot)
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ This is a gem for better workflow on you Mac. This only works on OSX and Mail.
6
+ For now the only thing the gem does is Disable and Enables email accounts, but I have planned to add more stuff that I feel wil make it easier to balanse between work and fun on my mac.
7
+
8
+ ## Why this gem?
9
+ I often found myself in the situation where I'm at work and personal email keeps flying into my mailbox, or I'm at home enjoying my weekend and work mail keeps flying in. This was really annoying, and manually disable accounts in Mail didn't cut it for me. So this is a gem you can use for disabling and enabling groups of email accounts.
6
10
 
7
11
  ## Installation
8
12
 
9
- Add this line to your application's Gemfile:
10
13
 
11
- ```ruby
12
- gem 'macbot'
13
- ```
14
+ $ gem install macbot
14
15
 
15
- And then execute:
16
+ $ macbot setup #creates initial yml file
17
+ ## Usage
18
+ The initial setup has two groups: work and privat, but you can create your own groups and manage them as you like
16
19
 
17
- $ bundle
20
+ ### Add a group
18
21
 
19
- Or install it yourself as:
22
+ $ macbot add --group yourGroupName
23
+
24
+ ### Add email to a group
20
25
 
21
- $ gem install macbot
26
+ **Important:** account must be name of your emailaccount in Mail
22
27
 
23
- ## Usage
28
+ $ macbot add --group yourGroupName --account youAccountName
29
+
30
+ ### Disable/Enable accounts
31
+
32
+ If your config is the following
33
+ ````yaml
34
+ work:
35
+ work1
36
+ work2
37
+ private:
38
+ private1
39
+ private2
40
+ someother:
41
+ other1
42
+ other2
43
+ ````
44
+ And u simply want to enable your work accounts
45
+
46
+ $ macbot work --enable
47
+
48
+ or u want to enable your work accounts, and disable all other accounts
49
+
50
+ $ macbot work --enable --zen
51
+
52
+ or u want to disable your work accounts
24
53
 
25
- TODO: Write usage instructions here
54
+ $ macbot work --disable
55
+
56
+ All the commands can be found in
26
57
 
27
- ## Development
58
+ $ macbot --help
59
+
60
+ Commands directly to your email group
28
61
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
62
+ $ macbot work --help
63
+ $ macbot [group] --help
30
64
 
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` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
65
 
33
66
  ## Contributing
34
67
 
@@ -18,7 +18,7 @@ module Macbot
18
18
  emails = data[type]
19
19
  string = ''
20
20
  string += build_string(emails, enable)
21
- string += enable_zen(emails, enable) if options.zen
21
+ string += enable_zen(type, enable, data) if options.zen
22
22
 
23
23
  MAIL_START + string + MAIL_END
24
24
  end
@@ -31,9 +31,13 @@ module Macbot
31
31
  puts 'what?'
32
32
  end
33
33
 
34
- def self.enable_zen(const, enable)
34
+ def self.enable_zen(type, enable, data)
35
35
  puts 'enable zen mode'
36
- build_string((Macbot::EMAIL_GROUPS - const), !enable)
36
+ string = ''
37
+ Macbot::EMAIL_GROUPS.each do |group|
38
+ string += build_string(data[group], !enable) unless group == type
39
+ end
40
+ string
37
41
  end
38
42
 
39
43
  def self.build_string(arr, enable)
@@ -1,7 +1,7 @@
1
1
  require 'yaml'
2
2
 
3
3
  module Macbot
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  NAME = 'Macbot'
6
6
  SUMMARY = 'Set it up to disable/enable accounts'
7
7
  YAML_PATH = 'email.yml'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: macbot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hilde Vestol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-05 00:00:00.000000000 Z
11
+ date: 2015-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander