pritch 0.0.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: dc99546d2ebb2f3fefab0bbd748c6e0834f81690
4
+ data.tar.gz: e731f939af495278ad99529e8ec406c31c0cffc0
5
+ SHA512:
6
+ metadata.gz: 4abf67b23ac0e6cf73f82188b664cff23bd51f58a688338a55cc68b1f341ef109f99e5135a3be5324bf2e3280c09f31371f5371d1dd7c2cd435511b3387ab42a
7
+ data.tar.gz: 802a21347b331f5b88bdefc287230452d62dae8e71bd31a0833d9e14c9791f9cbb7b28c6540e5dc1b4cea97058e94a88f3c039ea59cead25ef71edc5d0f417a9
data/.gitignore ADDED
@@ -0,0 +1,36 @@
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /test/tmp/
9
+ /test/version_tmp/
10
+ /tmp/
11
+
12
+ ## Specific to RubyMotion:
13
+ .dat*
14
+ .repl_history
15
+ build/
16
+
17
+ ## Documentation cache and generated files:
18
+ /.yardoc/
19
+ /_yardoc/
20
+ /doc/
21
+ /rdoc/
22
+
23
+ ## Environment normalisation:
24
+ /.bundle/
25
+ /lib/bundler/man/
26
+
27
+ # for a library or gem, you might want to ignore these files since the code is
28
+ # intended to run in multiple environments; otherwise, check them in:
29
+ # Gemfile.lock
30
+ # .ruby-version
31
+ # .ruby-gemset
32
+
33
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
34
+ .rvmrc
35
+
36
+ .pritch
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pike.gemspec
4
+ gemspec
5
+
6
+ group :testing do
7
+ gem 'coveralls', require: false
8
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,40 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ pritch (0.0.2)
5
+ colorize (~> 0.7)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ colorize (0.7.3)
11
+ coveralls (0.7.0)
12
+ multi_json (~> 1.3)
13
+ rest-client
14
+ simplecov (>= 0.7)
15
+ term-ansicolor
16
+ thor
17
+ docile (1.1.3)
18
+ mime-types (2.3)
19
+ multi_json (1.10.1)
20
+ rake (10.3.2)
21
+ rest-client (1.6.7)
22
+ mime-types (>= 1.16)
23
+ simplecov (0.8.2)
24
+ docile (~> 1.1.0)
25
+ multi_json
26
+ simplecov-html (~> 0.8.0)
27
+ simplecov-html (0.8.0)
28
+ term-ansicolor (1.3.0)
29
+ tins (~> 1.0)
30
+ thor (0.19.1)
31
+ tins (1.3.0)
32
+
33
+ PLATFORMS
34
+ ruby
35
+
36
+ DEPENDENCIES
37
+ bundler (~> 1.5)
38
+ coveralls
39
+ pritch!
40
+ rake (~> 10.1)
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Benjamin Kammerl
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,29 @@
1
+ pritch
2
+ ======
3
+
4
+ Command line tool, which let's you switch between projects like a pro (grammer).
5
+
6
+ Each day I find myself hard switching between projects multiple times. I'll do some work in project A, some documentation in project C, in my
7
+ lunchhour I code somewhat in a private project and switch back to my original project and so on. So it may be, that I just cancel my work
8
+ in a project instantly and start to work on something else. That's a hard switch. Or I just have to stop whatever I'm doing currently since
9
+ my cat acts like dying due hunger oder my girlfriend wants me to do the laundry or whatever reason.
10
+
11
+ After some time (in the worst case after some days) I'll get back to my project and want to continue wherever I've stopped. But I've no glue
12
+ where I stopped or what was the last thing, even less what was my thoughts. So I spent some time trying to find out what I did and what to do
13
+ next. You know what I mean, since you're a coder too. And of course you remember that comic
14
+ [why you shouldn't interrupt a programmer](http://heeris.id.au/2013/this-is-why-you-shouldnt-interrupt-a-programmer#!).
15
+
16
+ pritch is a handy tool which should help you to get back into your project or task as fast as possible. The idea behind is simple: If you stop
17
+ working on a project, type `leave` in your CLI while being in the root directory of your project. pritch will ask you what you just did and
18
+ whats the next step to do if you come back to the project. You should answer them in as few words as possible but enough to understand it
19
+ again if you read it days later.
20
+
21
+ After you get back to your project a coffee, nap or even days later, type `re` in your command line while being in the projects directory
22
+ and pritch will tell you what you've done before leaving and what's the next thing to do.
23
+
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ gem install pritch
29
+ ```
data/bin/leave ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pritch'
4
+ Pritch.leave
data/bin/re ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'pritch'
4
+ Pritch.re
data/lib/pritch.rb ADDED
@@ -0,0 +1,37 @@
1
+ require 'pritch/no_data_exception'
2
+ require 'pritch/persistence'
3
+ require 'colorize'
4
+
5
+ module Pritch
6
+ def self.leave
7
+ puts "What did you just do?".yellow
8
+ print " > ".blue
9
+ did = gets
10
+
11
+ puts
12
+ puts "What's the next thing to do?".yellow
13
+ print " > ".blue
14
+ todo = gets
15
+
16
+ Pritch::Persistence.save(did, todo)
17
+ end
18
+
19
+ def self.re
20
+ begin
21
+ did, todo = Pritch::Persistence.load
22
+ rescue NoDataException => e
23
+ puts "No information available. You should use #{'`leave`'.light_white} the next time you stop working on that project."
24
+ puts
25
+ exit
26
+ end
27
+
28
+ puts "What you did before you left:".yellow
29
+ puts
30
+ puts " #{did}".light_white
31
+ puts
32
+ puts "Next thing you should do:".yellow
33
+ puts
34
+ puts " #{todo}".light_white
35
+ puts
36
+ end
37
+ end
@@ -0,0 +1,2 @@
1
+ class NoDataException < Exception
2
+ end
@@ -0,0 +1,22 @@
1
+ require 'pritch/no_data_exception'
2
+
3
+ module Pritch
4
+ class Persistence
5
+ class << self
6
+ public def save(did, todo)
7
+ file = File.open('.pritch', 'w')
8
+ file.write(did + "\n-\n" + todo)
9
+ file.close
10
+ end
11
+
12
+ public def load
13
+ raise NoDataException unless File.exists?('.pritch')
14
+ file = File.open('.pritch', 'r')
15
+ content = file.read.split("\n-\n")
16
+ file.close
17
+ File.delete('.pritch')
18
+ content
19
+ end
20
+ end
21
+ end
22
+ end
data/pritch.gemspec ADDED
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib/', __FILE__)
3
+ $:.unshift(lib) unless $:.include?(lib)
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'pritch'
7
+ s.version = '0.0.2'
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ['Benjamin Kammerl']
10
+ s.email = ['benny@itws.de']
11
+ s.description = "Command line tool, which let's you switch between projects like a pro (grammer)"
12
+ s.summary = 'pritch is a handy tool which should help you to get back into your project or task as fast as possible'
13
+ s.homepage = 'https://github.com/phortx/pritch'
14
+ s.license = 'MIT'
15
+
16
+ s.required_ruby_version = '>= 2.0.0'
17
+
18
+ s.files = `git ls-files`.split($/)
19
+ s.executables = s.files.grep(/^bin\//) { |f| File.basename(f) }
20
+ s.test_files = s.files.grep(/^spec\//)
21
+ s.require_paths = ['lib']
22
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
+ s.extra_rdoc_files = ['README.md']
24
+
25
+ s.add_development_dependency 'bundler', '~> 1.5'
26
+ s.add_development_dependency 'rake', '~> 10.1'
27
+
28
+ s.add_dependency 'colorize', '~> 0.7'
29
+ end
metadata ADDED
@@ -0,0 +1,102 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pritch
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Benjamin Kammerl
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-06 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.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
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.1'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: colorize
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.7'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.7'
55
+ description: Command line tool, which let's you switch between projects like a pro
56
+ (grammer)
57
+ email:
58
+ - benny@itws.de
59
+ executables:
60
+ - leave
61
+ - re
62
+ extensions: []
63
+ extra_rdoc_files:
64
+ - README.md
65
+ files:
66
+ - ".gitignore"
67
+ - Gemfile
68
+ - Gemfile.lock
69
+ - LICENSE
70
+ - README.md
71
+ - bin/leave
72
+ - bin/re
73
+ - lib/pritch.rb
74
+ - lib/pritch/no_data_exception.rb
75
+ - lib/pritch/persistence.rb
76
+ - pritch.gemspec
77
+ homepage: https://github.com/phortx/pritch
78
+ licenses:
79
+ - MIT
80
+ metadata: {}
81
+ post_install_message:
82
+ rdoc_options: []
83
+ require_paths:
84
+ - lib
85
+ required_ruby_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 2.0.0
90
+ required_rubygems_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ requirements: []
96
+ rubyforge_project:
97
+ rubygems_version: 2.2.2
98
+ signing_key:
99
+ specification_version: 4
100
+ summary: pritch is a handy tool which should help you to get back into your project
101
+ or task as fast as possible
102
+ test_files: []