git-sleep 0.0.0 → 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.
- data/README.md +13 -1
- data/bin/git-sleep +38 -3
- data/git-sleep.gemspec +1 -0
- data/lib/git-sleep.rb +3 -1
- metadata +17 -1
data/README.md
CHANGED
@@ -1 +1,13 @@
|
|
1
|
-
|
1
|
+
# git sleep
|
2
|
+
|
3
|
+
`gem install git-sleep`
|
4
|
+
|
5
|
+
to be used in conjunction with [website goes here](#)
|
6
|
+
|
7
|
+
## usage (planned):
|
8
|
+
|
9
|
+
`git sleep authorize` will walk you through authorizing with Jawbone
|
10
|
+
|
11
|
+
`git sleep init` (from within a git repo) will install a git pre-commit hook for you
|
12
|
+
|
13
|
+
now when you try to commit to this repo, it will check if you really *should* be committing to this repo
|
data/bin/git-sleep
CHANGED
@@ -1,6 +1,41 @@
|
|
1
|
-
#!/usr/bin/ruby
|
1
|
+
#!/usr/bin/env ruby
|
2
2
|
|
3
|
+
require 'rubygems'
|
4
|
+
require 'netrc'
|
3
5
|
require File.expand_path('../../lib/git-sleep', __FILE__)
|
4
|
-
require 'optparse'
|
5
6
|
|
6
|
-
|
7
|
+
netrc = Netrc.read(GitSleep::NETRC_PATH)
|
8
|
+
|
9
|
+
help_text = "Available commands:
|
10
|
+
git sleep authorize
|
11
|
+
git sleep init"
|
12
|
+
|
13
|
+
case ARGV.length
|
14
|
+
when 0
|
15
|
+
puts help_text
|
16
|
+
when 1
|
17
|
+
case ARGV.first.downcase.to_sym
|
18
|
+
when :init
|
19
|
+
current_path = File.expand_path(".")
|
20
|
+
if Dir.entries(current_path).include?(".git")
|
21
|
+
puts "This is a git repo, so I'll now install the hook"
|
22
|
+
else
|
23
|
+
puts "This is not a git repo!"
|
24
|
+
end
|
25
|
+
when :authorize
|
26
|
+
puts "Visit #{GitSleep::OUR_SITE} to get the necessary information"
|
27
|
+
puts "what is your xid?"
|
28
|
+
print "> "
|
29
|
+
xid = $stdin.gets.chomp
|
30
|
+
puts "what is your token?"
|
31
|
+
print "> "
|
32
|
+
token = $stdin.gets.chomp
|
33
|
+
netrc.new_item_prefix = "\n# jawbone xid and sleepytime token\n"
|
34
|
+
netrc["sleepytime.com"] = xid, token
|
35
|
+
netrc.save
|
36
|
+
else # unrecognized command
|
37
|
+
puts help_text
|
38
|
+
end
|
39
|
+
else # other amounts of arguments
|
40
|
+
puts help_text
|
41
|
+
end
|
data/git-sleep.gemspec
CHANGED
data/lib/git-sleep.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-sleep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -29,6 +29,22 @@ dependencies:
|
|
29
29
|
- - ! '>='
|
30
30
|
- !ruby/object:Gem::Version
|
31
31
|
version: '0'
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: netrc
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
32
48
|
description: Uses Jawbone to figure out if you are awake enough to code
|
33
49
|
email:
|
34
50
|
- maxwell.jacobson@gmail.com
|