mailbot 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/mailbot +0 -1
- data/lib/mailbot/command_factory.rb +2 -2
- data/lib/mailbot/commands/sync.rb +13 -1
- data/lib/mailbot/errors.rb +4 -1
- data/lib/mailbot/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9359f348fbe935c4fe446d9da7130ba9554a2a34
|
4
|
+
data.tar.gz: 37e498478b89c2e999c6f64c352ea7aa3ae53fdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9a6bf3127c8fd89ca0380092bc3c87f0f0e603d61aeb5c080d3c25c9fe40b1ee56e7c396b9afc6798226ab6d7b80689a19bc0e08859f8f4f1f04c8c58ceab9e
|
7
|
+
data.tar.gz: b9a9f653a8da0b924c3ad045e47b46671f3f5694438e6a0b126408a7d28adc03620f53527dd7aaf1eb4638f1ad04d6fcf42c3edc3f1f3f527fbe93c5acff58be
|
data/bin/mailbot
CHANGED
@@ -15,7 +15,7 @@ module Mailbot
|
|
15
15
|
# @return [Mailbot::Commands::Base]
|
16
16
|
def create
|
17
17
|
command_class.new @argv
|
18
|
-
rescue Errors::
|
18
|
+
rescue Errors::CommandNotFoundError
|
19
19
|
terminate
|
20
20
|
end
|
21
21
|
|
@@ -26,7 +26,7 @@ module Mailbot
|
|
26
26
|
when "sync"
|
27
27
|
Commands::Sync
|
28
28
|
else
|
29
|
-
raise Errors::
|
29
|
+
raise Errors::CommandNotFoundError
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
@@ -9,19 +9,31 @@ module Mailbot
|
|
9
9
|
|
10
10
|
# Sync given file to Mailbox
|
11
11
|
def execute
|
12
|
+
load_env!
|
12
13
|
Mailbot::Repository.new(file).sync
|
13
14
|
end
|
14
15
|
|
15
16
|
private
|
16
17
|
|
18
|
+
def load_env!
|
19
|
+
Dotenv.load! env
|
20
|
+
end
|
21
|
+
|
17
22
|
def file
|
18
|
-
options[:file]
|
23
|
+
option = options[:file]
|
24
|
+
raise Errors::CommandPreconditionError.new "option `file` must be specified" unless option
|
25
|
+
option
|
26
|
+
end
|
27
|
+
|
28
|
+
def env
|
29
|
+
options[:env] || ".env"
|
19
30
|
end
|
20
31
|
|
21
32
|
def options
|
22
33
|
@options ||= Slop.parse!(@argv, help: true) do
|
23
34
|
banner "Usage: #{$0} sync [options]"
|
24
35
|
on "file=", "Path to the markdown file to sync"
|
36
|
+
on "env=", "Path to the env file to sync"
|
25
37
|
end
|
26
38
|
end
|
27
39
|
|
data/lib/mailbot/errors.rb
CHANGED
data/lib/mailbot/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailbot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- monzou
|
@@ -157,10 +157,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
159
|
rubyforge_project:
|
160
|
-
rubygems_version: 2.
|
160
|
+
rubygems_version: 2.2.2
|
161
161
|
signing_key:
|
162
162
|
specification_version: 4
|
163
163
|
summary: Learn with Mailbox
|
164
164
|
test_files:
|
165
165
|
- test/entry_test.rb
|
166
166
|
- test/test_helper.rb
|
167
|
+
has_rdoc:
|