showlog 0.0.1

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: 68ddb105d2212da095c7ba73bd66fa30ee4b9bf2
4
+ data.tar.gz: fc6a44d25b4f9fc7c54800c661c44a83635083cd
5
+ SHA512:
6
+ metadata.gz: 7e9d7bd3dfa7b0411bb331ecb87469a14d4deae0e08d34c64cd6ae9a9df961f21b9ff8e412b926aab33909f108ffa30b86134d927933d6daa3eb8859e3440bc3
7
+ data.tar.gz: 2565707312db7b178ea38fcc0427b7e88deb21c8773f319bd32ffd204d6f4fd523c1f4b3d2ab3e21c6478e7eb0477310aed89dafc8a4e5a1e8ed363e4e14a59e
data/.gitignore ADDED
@@ -0,0 +1,19 @@
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
+ .idea
19
+ *.iml
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format Fuubar
data/.travis.yml ADDED
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.0.0
4
+ - 2.1.0
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in show-gitlog.gemspec
4
+ gemspec
data/Guardfile ADDED
@@ -0,0 +1,6 @@
1
+ guard :rspec, spring: true do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
+ watch('spec/spec_helper.rb') { "spec" }
5
+ end
6
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 foostan
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,63 @@
1
+ # Showlog
2
+ [![Build Status](https://travis-ci.org/foostan/showlog.svg?branch=master)](https://travis-ci.org/foostan/showlog) [![Coverage Status](https://coveralls.io/repos/foostan/showlog/badge.png)](https://coveralls.io/r/foostan/showlog) [![Code Climate](https://codeclimate.com/github/foostan/showlog.png)](https://codeclimate.com/github/foostan/showlog)
3
+
4
+ ## Installation
5
+
6
+ Add this line to your application's Gemfile:
7
+
8
+ gem 'showlog'
9
+
10
+ And then execute:
11
+
12
+ $ bundle
13
+
14
+ Or install it yourself as:
15
+
16
+ $ gem install showlog
17
+
18
+
19
+ ## Usage
20
+ ```
21
+ Commands:
22
+ showlog git # show git commit logs of local environment
23
+ showlog help [COMMAND] # Describe available commands or one specific command
24
+ ```
25
+
26
+ ### showlog git
27
+ ```
28
+ Usage:
29
+ showlog git
30
+
31
+ Options:
32
+ p, [--path=PATH]
33
+ # Default: .
34
+ s, [--since=SINCE]
35
+ # Default: 1.days.ago
36
+ a, [--author=AUTHOR]
37
+ # Default: foostan
38
+ f, [--format=FORMAT]
39
+ # Default: noformat
40
+
41
+ show git commit logs of local environment
42
+ ```
43
+
44
+ #### Example
45
+ ```
46
+ > showlog git
47
+ /Users/foostan/sandbox/showlog
48
+ 2632af7 Mon Jun 9 23:43:00 2014::first commit
49
+ dd266f2 Tue Jun 10 00:02:33 2014::Add thor cli
50
+ 112f095 Tue Jun 10 00:26:10 2014::Add rspec environment
51
+ a8ae40c Tue Jun 10 00:30:16 2014::Enable travis ci
52
+ 60a81f7 Tue Jun 10 00:36:53 2014::Add badges
53
+ 7984176 Tue Jun 10 01:08:20 2014::Rename command to showlog
54
+ eed4ade Tue Jun 10 02:16:09 2014: (HEAD, origin/master, master):Add git command
55
+ ```
56
+
57
+ ## Contributing
58
+
59
+ 1. Fork it
60
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
61
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
62
+ 4. Push to the branch (`git push origin my-new-feature`)
63
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+ task default: :spec
data/bin/showlog ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ require 'showlog'
3
+
4
+ Showlog::Cli.start(ARGV)
5
+
@@ -0,0 +1,54 @@
1
+ require 'thor'
2
+
3
+ module Showlog
4
+ class Cli < Thor
5
+ desc 'git', 'show git commit logs of local environment'
6
+
7
+ option :path, aliases: :p, default: '.'
8
+ option :since, aliases: :s, default: '1.days.ago'
9
+ option :author, aliases: :a, default: `whoami`
10
+ option :format, aliases: :f, default: 'noformat'
11
+
12
+ def git
13
+ Dir.glob(File.expand_path(options[:path]) + '/**/.git', File::FNM_DOTMATCH).each do |git_dir|
14
+ repo_dir = File.dirname(git_dir)
15
+ git_log = `cd #{repo_dir}; git log --pretty=format:"%h %ad:%d:%s" --date=local --reverse --all --since=#{options[:since]} --author="#{options[:author]}" 2>/dev/null`.split("\n")
16
+ show_log(repo_dir, git_log, options[:format])
17
+ end
18
+ end
19
+
20
+ private
21
+
22
+ def show_log(headline, log, format = 'noformat')
23
+ case format
24
+ when 'markdown'
25
+ log.each_with_index do |row, i|
26
+ puts "## #{headline}" if i == 0
27
+ puts "- #{row}"
28
+ puts '' if i == log.length - 1
29
+ end
30
+
31
+ when 'html'
32
+ log.each_with_index do |row, i|
33
+ if i == 0
34
+ puts "<h2>#{headline}</h2>"
35
+ puts '<ul>'
36
+ end
37
+ puts " <li>#{row}</li>"
38
+ if i == log.length - 1
39
+ puts '</ul>'
40
+ puts ''
41
+ end
42
+ end
43
+
44
+ when 'noformat'
45
+ log.each_with_index do |row, i|
46
+ puts headline if i == 0
47
+ puts row
48
+ puts '' if i == log.length - 1
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+
@@ -0,0 +1,3 @@
1
+ module Showlog
2
+ VERSION = "0.0.1"
3
+ end
data/lib/showlog.rb ADDED
@@ -0,0 +1,5 @@
1
+ require 'showlog/version'
2
+ require 'showlog/cli'
3
+
4
+ module Showlog
5
+ end
data/showlog.gemspec ADDED
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'showlog/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'showlog'
8
+ spec.version = Showlog::VERSION
9
+ spec.authors = ['foostan']
10
+ spec.email = ['foostan27@gmail.com']
11
+ spec.description = %q{Show development logs}
12
+ spec.summary = %q{Show development logs}
13
+ spec.homepage = 'https://github.com/foostan/showlog'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'rspec', '~> 3.0.0'
24
+ spec.add_development_dependency 'guard-rspec'
25
+ spec.add_development_dependency 'fuubar', '~> 2.0.0.rc1'
26
+ spec.add_development_dependency 'spring'
27
+ spec.add_development_dependency 'coveralls'
28
+
29
+ spec.add_dependency 'thor'
30
+ end
@@ -0,0 +1,9 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
4
+ require 'rspec'
5
+ require 'guard/rspec'
6
+
7
+ RSpec.configure do |c|
8
+ c.mock_with :rspec
9
+ end
metadata ADDED
@@ -0,0 +1,172 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: showlog
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - foostan
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-09 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.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
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: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: 3.0.0
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: 3.0.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: guard-rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: fuubar
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 2.0.0.rc1
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 2.0.0.rc1
83
+ - !ruby/object:Gem::Dependency
84
+ name: spring
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: coveralls
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: thor
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: Show development logs
126
+ email:
127
+ - foostan27@gmail.com
128
+ executables:
129
+ - showlog
130
+ extensions: []
131
+ extra_rdoc_files: []
132
+ files:
133
+ - .gitignore
134
+ - .rspec
135
+ - .travis.yml
136
+ - Gemfile
137
+ - Guardfile
138
+ - LICENSE.txt
139
+ - README.md
140
+ - Rakefile
141
+ - bin/showlog
142
+ - lib/showlog.rb
143
+ - lib/showlog/cli.rb
144
+ - lib/showlog/version.rb
145
+ - showlog.gemspec
146
+ - spec/spec_helper.rb
147
+ homepage: https://github.com/foostan/showlog
148
+ licenses:
149
+ - MIT
150
+ metadata: {}
151
+ post_install_message:
152
+ rdoc_options: []
153
+ require_paths:
154
+ - lib
155
+ required_ruby_version: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ required_rubygems_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ requirements: []
166
+ rubyforge_project:
167
+ rubygems_version: 2.1.11
168
+ signing_key:
169
+ specification_version: 4
170
+ summary: Show development logs
171
+ test_files:
172
+ - spec/spec_helper.rb