githubwatcher 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -7,13 +7,12 @@ require 'bundler/gem_tasks'
7
7
  end
8
8
  end
9
9
 
10
- desc "Bump version on github"
10
+ desc 'Bump version on github'
11
11
  task :bump do
12
- puts "Nothing to commit (working directory clean)" and return if `git status -s`.strip == ""
13
- if `git status -s`.strip == ""
12
+ if `git status -s`.strip == ''
14
13
  puts "\e[31mNothing to commit (working directory clean)\e[0m"
15
14
  else
16
- version = Bundler.load_gemspec(Dir[File.expand_path('../*.gemspec', __FILE__)].first).version
15
+ version = Bundler.load_gemspec(Dir[File.expand_path('../*.gemspec', __FILE__)].first).version
17
16
  sh "git add .; git commit -a -m \"Bump to version #{version}\""
18
17
  end
19
18
  end
@@ -1,35 +1,36 @@
1
1
  #!/usr/bin/ruby
2
- ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
3
-
2
+ $:.unshift File.expand_path('../../lib', __FILE__)
4
3
  require 'rubygems' unless defined?(Gem)
5
- require 'bundler/setup'
6
4
  require 'forever'
7
5
  require 'githubwatcher'
8
6
 
9
- if ARGV.any? { |cmd| cmd =~ /configure/ }
10
- editor = `which mate`.chomp! || `which vim`.chomp!
11
- puts "Im unable to find an editor, open manually ~/.githubwatcher/repos.yaml" and exit unless editor
12
- system editor, File.expand_path('~/.githubwatcher/repos.yaml') and exit
7
+ case arg = ARGV[0]
8
+ when "configure"
9
+ editor = `which mate`.chomp! || `which vim`.chomp!
10
+ puts "Im unable to find an editor, open manually ~/.githubwatcher/repos.yaml" and exit unless editor
11
+ system editor, File.expand_path('~/.githubwatcher/repos.yaml') and exit
12
+ when "reset"
13
+ system "rm -rf ~/.githubwatcher"
13
14
  end
14
15
 
15
16
  Forever.run do
16
- # Our working directory, here we store pids/logs and obviously our list of repo to watch
17
17
  dir File.expand_path('~/.githubwatcher')
18
18
 
19
19
  on_error do |e|
20
- Githubwatcher.notify("Error!", e.message)
20
+ Githubwatcher.notify("Error!", e.message) unless @_errors.include?(e.message)
21
21
  end
22
22
 
23
- on_ready do
23
+ before :all do
24
24
  Githubwatcher.setup
25
25
  Githubwatcher.notify("GitHub Watcher", "was started...")
26
- end
27
-
28
- on_exit do
29
- Githubwatcher.notify("GitHub Watcher", "was stopped...")
26
+ @_errors = [] # Store common errors
30
27
  end
31
28
 
32
29
  every 5.seconds do
33
30
  Githubwatcher.run
34
31
  end
35
- end
32
+
33
+ after :all do
34
+ Githubwatcher.notify("GitHub Watcher", "was stopped...")
35
+ end
36
+ end
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = %w[lib]
20
20
  s.add_dependency 'httparty', '~>0.7.8'
21
21
  s.add_dependency 'growl', '~>1.0.3'
22
- s.add_dependency 'foreverb', '~>0.2.6'
22
+ s.add_dependency 'foreverb', '~>0.3.0'
23
23
  end
@@ -31,8 +31,8 @@ module Githubwatcher
31
31
  end
32
32
 
33
33
  @_watch = YAML.load_file(WATCH)
34
- @_repos = YAML.load_file(DB) if File.exist?(DB)
35
34
  @base_uri, @api_version = YAML.load_file(API)
35
+ @_repos = YAML.load_file(DB) if File.exist?(DB)
36
36
 
37
37
  base_uri @base_uri
38
38
  end
@@ -93,8 +93,8 @@ module Githubwatcher
93
93
  @_watch ||= []
94
94
  end
95
95
 
96
- def notify(title, text)
97
- Growl.notify text, :title => title, :icon => File.expand_path("../../images/icon.png", __FILE__); sleep 0.2
96
+ def notify(title, text, sticky=false)
97
+ Growl.notify(text, :title => title, :icon => File.expand_path("../../images/icon.png", __FILE__), :sticky => sticky); sleep 0.2
98
98
  puts "=> #{title}: #{text}"
99
99
  end
100
100
 
@@ -113,4 +113,4 @@ module Githubwatcher
113
113
  raise "Unkown api version"
114
114
  end
115
115
  end
116
- end
116
+ end
@@ -1,3 +1,3 @@
1
1
  module Githubwatcher
2
- VERSION = "0.0.9"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: githubwatcher
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
+ - 1
8
9
  - 0
9
- - 9
10
- version: 0.0.9
10
+ version: 0.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Davide D'Agostino
@@ -15,8 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-27 00:00:00 +02:00
19
- default_executable:
18
+ date: 2012-01-25 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
22
21
  name: httparty
@@ -58,12 +57,12 @@ dependencies:
58
57
  requirements:
59
58
  - - ~>
60
59
  - !ruby/object:Gem::Version
61
- hash: 27
60
+ hash: 19
62
61
  segments:
63
62
  - 0
64
- - 2
65
- - 6
66
- version: 0.2.6
63
+ - 3
64
+ - 0
65
+ version: 0.3.0
67
66
  type: :runtime
68
67
  version_requirements: *id003
69
68
  description: Github Growl Watcher, watch any project and receive growl notification for updates, new watchers, forks and issues
@@ -84,7 +83,6 @@ files:
84
83
  - lib/githubwatcher.rb
85
84
  - Rakefile
86
85
  - README.md
87
- has_rdoc: true
88
86
  homepage: https://github.com/DAddYE/githubwatcher
89
87
  licenses: []
90
88
 
@@ -114,9 +112,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
112
  requirements: []
115
113
 
116
114
  rubyforge_project: githubwatcher
117
- rubygems_version: 1.6.2
115
+ rubygems_version: 1.8.15
118
116
  signing_key:
119
117
  specification_version: 3
120
118
  summary: Github Growl Watcher, watch any project and receive growl notification
121
119
  test_files: []
122
120
 
121
+ has_rdoc: