wloger 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5ad03d67e07ac8ce1c6328f55d7abaf6281b4b9c
4
+ data.tar.gz: 1338e085a151826c7a6827c2f048486c406b7a73
5
+ SHA512:
6
+ metadata.gz: 3a7b113e58af1da48667881b6435a6e3c5191f8650376702c6903c19cf4720892e37bfb1aca42de3745a3779f8ce04e50602ff2a607655b048fbbfdff54857c1
7
+ data.tar.gz: c22a9b7f1d1beeeb11c2dd8c5d0257e3537a01d95fd3b30a7dea99f0a733179a8735f4dd20110d18eb86622ba95e4607e95d58c491d2d920c11a010bf8ba0f80
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in wloger.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 huyu398
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # Wloger
2
+
3
+ Wloger help to manage your daily work-logs.
4
+
5
+ ## Installation
6
+
7
+ Install it yourself as:
8
+
9
+ $ gem install wloger
10
+
11
+ ## Usage
12
+
13
+ If you log today, execute following command.
14
+
15
+ $ wloger
16
+
17
+ Wloger make log directory to store, and execute editor!!
18
+
19
+ ## TODO
20
+
21
+ - [ ] setting to select your editor
22
+ - [ ] setting for log directory name
23
+ - [ ] able to change stored directory
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/wloger/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/wloger ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path(File.dirname(__FILE__) + '/../lib')
4
+ begin
5
+ require 'wloger'
6
+ rescue LoadError
7
+ $LOAD_PATH << lib
8
+ require 'wloger'
9
+ end
10
+
11
+ Wloger::Command.execute(*ARGV)
@@ -0,0 +1,20 @@
1
+ require 'date'
2
+
3
+ module Wloger
4
+ # Command line parse class
5
+ class Command
6
+ class << self
7
+ def execute(*args)
8
+ # argument parse
9
+ date = Date.parse(args.first) unless args.first.nil?
10
+ date ||= Date.today
11
+
12
+ @directory = Wloger::DirectoryController.new(date)
13
+ @editor = Wloger::Editor.new
14
+
15
+ @directory.make_today_directory
16
+ @editor.edit(@directory.log_dir, @directory.log_name)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,22 @@
1
+ require 'fileutils'
2
+
3
+ module Wloger
4
+ # control work-log directories and current directory class
5
+ class DirectoryController
6
+ LOG_DIR_NAME = 'work_log'.freeze
7
+ PARENT_LOG_DIR = 'Documents'.freeze
8
+
9
+ attr_accessor :log_dir
10
+ attr_accessor :log_name
11
+
12
+ def initialize(date)
13
+ @log_dir = File.expand_path("~/#{PARENT_LOG_DIR}/#{LOG_DIR_NAME}/#{date.strftime('%Y_%b/%d')}")
14
+ @log_name = date.strftime('%d')
15
+ end
16
+
17
+ # recursively make work-log directory of today
18
+ def make_today_directory
19
+ FileUtils.mkdir_p(@log_dir) unless Dir.exist?(@log_dir)
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,11 @@
1
+ module Wloger
2
+ # using editor for work-log class
3
+ class Editor
4
+ EDITOR_NAME = 'vim'.freeze
5
+ EXTENTION = 'md'.freeze
6
+
7
+ def edit(log_dir, log_name)
8
+ system("#{EDITOR_NAME} #{log_dir}/#{log_name}.#{EXTENTION}")
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module Wloger
2
+ VERSION = "0.0.1"
3
+ end
data/lib/wloger.rb ADDED
@@ -0,0 +1,8 @@
1
+ require 'wloger/command'
2
+ require 'wloger/directory_controller'
3
+ require 'wloger/editor'
4
+ require 'wloger/version'
5
+
6
+ module Wloger
7
+ # Your code goes here...
8
+ end
data/wloger.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'wloger/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'wloger'
8
+ spec.version = Wloger::VERSION
9
+ spec.authors = ['huyu398']
10
+ spec.email = ['huyu.sakuya4645@gmail.com']
11
+ spec.summary = %q(Wloger help to manage your daily work-logs.)
12
+ spec.description = %q(Wloger manages the directory control of work-logs and automatically select the editor for work-logs.)
13
+ spec.homepage = 'https://github.com/huyu398/wloger'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(/^bin\//) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(/^(test|spec|features)\//)
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.6'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'pry'
24
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wloger
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - huyu398
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-05-20 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.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Wloger manages the directory control of work-logs and automatically select
56
+ the editor for work-logs.
57
+ email:
58
+ - huyu.sakuya4645@gmail.com
59
+ executables:
60
+ - wloger
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".gitignore"
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/wloger
70
+ - lib/wloger.rb
71
+ - lib/wloger/command.rb
72
+ - lib/wloger/directory_controller.rb
73
+ - lib/wloger/editor.rb
74
+ - lib/wloger/version.rb
75
+ - wloger.gemspec
76
+ homepage: https://github.com/huyu398/wloger
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.2.0
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Wloger help to manage your daily work-logs.
100
+ test_files: []