poe 0.0.0 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +1 -0
- data/README.md +20 -0
- data/VERSION +1 -1
- data/bin/poe +5 -1
- data/config.yml +2 -0
- data/hooks/build-failed +5 -0
- data/hooks/build-worked +5 -0
- data/hooks/common.rb +19 -0
- data/hooks/post-update +3 -0
- data/lib/poe.rb +58 -0
- data/poe.gemspec +10 -4
- metadata +11 -9
- data/README.rdoc +0 -17
data/.gitignore
CHANGED
data/Gemfile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
gem 'cijoe'
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
poe
|
2
|
+
===
|
3
|
+
|
4
|
+
Utility to configure a cijoe for a repository
|
5
|
+
|
6
|
+
- it copies `.build-failed` `.build-worked` files from your `~/.poe/` directory to
|
7
|
+
your `.git/hooks` directory
|
8
|
+
|
9
|
+
TODO
|
10
|
+
====
|
11
|
+
1. Create a directory called `~/.poe` on installation and copy the `hooks`
|
12
|
+
directory to `~/.poe` also copy the config file `poe.yml` to
|
13
|
+
2. Change the script to check the config file for the default runner and the
|
14
|
+
*to* email id
|
15
|
+
3. Finally, make it wireup cijoe so that it starts as a deamon on login
|
16
|
+
|
17
|
+
Copyright
|
18
|
+
=========
|
19
|
+
|
20
|
+
Copyright (c) 2010 Khaja Minhajuddin. See LICENSE for details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/bin/poe
CHANGED
data/config.yml
ADDED
data/hooks/build-failed
ADDED
data/hooks/build-worked
ADDED
data/hooks/common.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mail'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
|
5
|
+
class Notifier
|
6
|
+
@@config = YAML::load_file(File.join('~/.poe', 'config.yml')
|
7
|
+
|
8
|
+
def send_mail(options => {:from => ENV['AUTHOR'], :to => @@config["to"], :body => ENV["OUTPUT"]})
|
9
|
+
mail = Mail.new do
|
10
|
+
from options[:from]
|
11
|
+
to options[:to]
|
12
|
+
subject options[:subject]
|
13
|
+
body options[:body]
|
14
|
+
end
|
15
|
+
|
16
|
+
mail.deliver!
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/hooks/post-update
ADDED
data/lib/poe.rb
CHANGED
@@ -1,2 +1,60 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
|
1
3
|
class Poe
|
4
|
+
|
5
|
+
@@hooks = ['build-failed', 'build-worked', 'common.rb']
|
6
|
+
|
7
|
+
def initialize(dir)
|
8
|
+
@dir = dir
|
9
|
+
end
|
10
|
+
|
11
|
+
def run
|
12
|
+
unless valid?
|
13
|
+
display_errors
|
14
|
+
return
|
15
|
+
end
|
16
|
+
setup
|
17
|
+
puts "drop kick => '#@dir'"
|
18
|
+
end
|
19
|
+
|
20
|
+
def setup
|
21
|
+
#copy the hooks
|
22
|
+
copy_hooks
|
23
|
+
#setup the default runner
|
24
|
+
setup_runner
|
25
|
+
end
|
26
|
+
|
27
|
+
|
28
|
+
def copy_hooks
|
29
|
+
src_dir = File.join(home_dir, '.poe', 'hooks')
|
30
|
+
tgt_dir = File.join(@dir, '.git', 'hooks')
|
31
|
+
|
32
|
+
@@hooks.each do |h|
|
33
|
+
FileUtils.cp File.join(src_dir, h), tgt_dir
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
def setup_runner
|
39
|
+
`cd #@dir && git config --add cijoe.runner "bundle exec rspec spec"`
|
40
|
+
end
|
41
|
+
|
42
|
+
def home_dir
|
43
|
+
File.expand_path('~')
|
44
|
+
end
|
45
|
+
|
46
|
+
def valid?
|
47
|
+
errors << "'#{@dir}' does not exist" unless File.exists?(@dir)
|
48
|
+
errors << "'#{@dir}' is not a git repo" unless File.exists?(File.join(@dir, '.git'))
|
49
|
+
errors.empty?
|
50
|
+
end
|
51
|
+
|
52
|
+
def errors
|
53
|
+
@errors ||= []
|
54
|
+
end
|
55
|
+
|
56
|
+
def display_errors
|
57
|
+
puts "Dang! something's wrong:\n\t#{errors.join("\n\t")}"
|
58
|
+
end
|
59
|
+
|
2
60
|
end
|
data/poe.gemspec
CHANGED
@@ -5,27 +5,33 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{poe}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Khaja Minhajuddin"]
|
12
|
-
s.date = %q{2010-11-
|
12
|
+
s.date = %q{2010-11-08}
|
13
13
|
s.default_executable = %q{poe}
|
14
14
|
s.description = %q{utility to configure cijoe}
|
15
15
|
s.email = %q{minhajuddin@cosmicvent.com}
|
16
16
|
s.executables = ["poe"]
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"LICENSE",
|
19
|
-
"README.
|
19
|
+
"README.md"
|
20
20
|
]
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
23
|
".gitignore",
|
24
|
+
"Gemfile",
|
24
25
|
"LICENSE",
|
25
|
-
"README.
|
26
|
+
"README.md",
|
26
27
|
"Rakefile",
|
27
28
|
"VERSION",
|
28
29
|
"bin/poe",
|
30
|
+
"config.yml",
|
31
|
+
"hooks/build-failed",
|
32
|
+
"hooks/build-worked",
|
33
|
+
"hooks/common.rb",
|
34
|
+
"hooks/post-update",
|
29
35
|
"lib/poe.rb",
|
30
36
|
"poe.gemspec",
|
31
37
|
"test/helper.rb",
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: poe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 31
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Khaja Minhajuddin
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-11-
|
17
|
+
date: 2010-11-08 00:00:00 +05:30
|
19
18
|
default_executable: poe
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -26,7 +25,6 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
28
|
segments:
|
31
29
|
- 0
|
32
30
|
version: "0"
|
@@ -40,15 +38,21 @@ extensions: []
|
|
40
38
|
|
41
39
|
extra_rdoc_files:
|
42
40
|
- LICENSE
|
43
|
-
- README.
|
41
|
+
- README.md
|
44
42
|
files:
|
45
43
|
- .document
|
46
44
|
- .gitignore
|
45
|
+
- Gemfile
|
47
46
|
- LICENSE
|
48
|
-
- README.
|
47
|
+
- README.md
|
49
48
|
- Rakefile
|
50
49
|
- VERSION
|
51
50
|
- bin/poe
|
51
|
+
- config.yml
|
52
|
+
- hooks/build-failed
|
53
|
+
- hooks/build-worked
|
54
|
+
- hooks/common.rb
|
55
|
+
- hooks/post-update
|
52
56
|
- lib/poe.rb
|
53
57
|
- poe.gemspec
|
54
58
|
- test/helper.rb
|
@@ -67,7 +71,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
71
|
requirements:
|
68
72
|
- - ">="
|
69
73
|
- !ruby/object:Gem::Version
|
70
|
-
hash: 3
|
71
74
|
segments:
|
72
75
|
- 0
|
73
76
|
version: "0"
|
@@ -76,7 +79,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
79
|
requirements:
|
77
80
|
- - ">="
|
78
81
|
- !ruby/object:Gem::Version
|
79
|
-
hash: 3
|
80
82
|
segments:
|
81
83
|
- 0
|
82
84
|
version: "0"
|
data/README.rdoc
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
= poe
|
2
|
-
|
3
|
-
Description goes here.
|
4
|
-
|
5
|
-
== Note on Patches/Pull Requests
|
6
|
-
|
7
|
-
* Fork the project.
|
8
|
-
* Make your feature addition or bug fix.
|
9
|
-
* Add tests for it. This is important so I don't break it in a
|
10
|
-
future version unintentionally.
|
11
|
-
* Commit, do not mess with rakefile, version, or history.
|
12
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
-
* Send me a pull request. Bonus points for topic branches.
|
14
|
-
|
15
|
-
== Copyright
|
16
|
-
|
17
|
-
Copyright (c) 2010 Khaja Minhajuddin. See LICENSE for details.
|