progressions-g 1.3.1.test

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ *.gem
2
+ pkg
3
+
data/README.markdown ADDED
@@ -0,0 +1,67 @@
1
+ g
2
+ ========
3
+
4
+ [http://github.com/jugyo/g/tree/master](http://github.com/jugyo/g/tree/master)
5
+
6
+ Description
7
+ --------
8
+
9
+ The Kernel.g that works like Kernel.p on growl :)
10
+
11
+ Install
12
+ --------
13
+
14
+ sudo gem install g
15
+
16
+ or
17
+
18
+ sudo gem install jugyo-g --source http://gems.github.com
19
+
20
+ Synopsis
21
+ --------
22
+
23
+ require 'rubygems'
24
+ require 'g'
25
+
26
+ g 'foo'
27
+ g 1
28
+ g self
29
+ g %w(foo bar)
30
+ g ({:a=>"aaaaaaaaaaaaaaaaaa",
31
+ :b=>"bbbbbbbbbbbbbbbbbbb",
32
+ :c=>
33
+ ["cccccccccccccccc",
34
+ "CCCCCCCCCCCCCCCCC",
35
+ "c c c c c ",
36
+ "C C C C C C C C C "]})
37
+
38
+ Requirements
39
+ --------
40
+
41
+ * ruby-growl
42
+
43
+ License
44
+ --------
45
+
46
+ (The MIT License)
47
+
48
+ Copyright (c) 2008-2009 jugyo
49
+
50
+ Permission is hereby granted, free of charge, to any person obtaining
51
+ a copy of this software and associated documentation files (the
52
+ 'Software'), to deal in the Software without restriction, including
53
+ without limitation the rights to use, copy, modify, merge, publish,
54
+ distribute, sublicense, and/or sell copies of the Software, and to
55
+ permit persons to whom the Software is furnished to do so, subject to
56
+ the following conditions:
57
+
58
+ The above copyright notice and this permission notice shall be
59
+ included in all copies or substantial portions of the Software.
60
+
61
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
62
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
63
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
64
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
65
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
66
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
67
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,25 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "progressions-g"
8
+ gem.summary = %Q{g is like p}
9
+ gem.description = %Q{The Kernel.g that works like Kernel.p on growl :)}
10
+ gem.email = "progressions@gmail.com"
11
+ gem.homepage = "http://github.com/progressions/g"
12
+ gem.authors = ["jugyo", "Jeff Coleman"]
13
+ gem.add_development_dependency "rspec", ">= 0"
14
+ gem.add_dependency "ruby-growl", ">= 1.0.1"
15
+ end
16
+ rescue LoadError
17
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
18
+ end
19
+
20
+ require 'spec/rake/spectask'
21
+ desc 'run all specs'
22
+ Spec::Rake::SpecTask.new do |t|
23
+ t.spec_files = FileList['spec/**/*_spec.rb']
24
+ t.spec_opts = ['-c']
25
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.3.1.test
data/lib/g.rb ADDED
@@ -0,0 +1,40 @@
1
+ require 'rubygems'
2
+ require 'ruby-growl'
3
+ require 'pp'
4
+
5
+ $g_host ||= "localhost"
6
+ $g_priority ||= 0
7
+ $g_sticky ||= true
8
+
9
+ module Kernel
10
+ def g(*args, &block)
11
+
12
+ options = {}
13
+ if args.last.class == Hash
14
+ options = args.pop
15
+ end
16
+
17
+ title = options[:title] || 'g'
18
+
19
+ growl = Growl.new $g_host, title, [$0]
20
+
21
+ args.push(block) if block
22
+
23
+ messages =
24
+ if args.empty?
25
+ ['g!']
26
+ else
27
+ args.map { |i| i.pretty_inspect }
28
+ end
29
+
30
+ messages.each { |i| growl.notify $0, title, i, $g_priority, $g_sticky }
31
+
32
+ if args.empty?
33
+ nil
34
+ elsif args.size == 1
35
+ args.first
36
+ else
37
+ args
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,52 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{progressions-g}
8
+ s.version = "1.3.1.test"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["jugyo", "Jeff Coleman"]
12
+ s.date = %q{2010-01-10}
13
+ s.description = %q{The Kernel.g that works like Kernel.p on growl :)}
14
+ s.email = %q{progressions@gmail.com}
15
+ s.extra_rdoc_files = [
16
+ "README.markdown"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "README.markdown",
21
+ "Rakefile",
22
+ "VERSION",
23
+ "lib/g.rb",
24
+ "progressions-g.gemspec",
25
+ "spec/g_spec.rb"
26
+ ]
27
+ s.homepage = %q{http://github.com/progressions/g}
28
+ s.rdoc_options = ["--charset=UTF-8"]
29
+ s.require_paths = ["lib"]
30
+ s.rubygems_version = %q{1.3.5}
31
+ s.summary = %q{g is like p}
32
+ s.test_files = [
33
+ "spec/g_spec.rb"
34
+ ]
35
+
36
+ if s.respond_to? :specification_version then
37
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
38
+ s.specification_version = 3
39
+
40
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
41
+ s.add_development_dependency(%q<rspec>, [">= 0"])
42
+ s.add_runtime_dependency(%q<ruby-growl>, [">= 1.0.1"])
43
+ else
44
+ s.add_dependency(%q<rspec>, [">= 0"])
45
+ s.add_dependency(%q<ruby-growl>, [">= 1.0.1"])
46
+ end
47
+ else
48
+ s.add_dependency(%q<rspec>, [">= 0"])
49
+ s.add_dependency(%q<ruby-growl>, [">= 1.0.1"])
50
+ end
51
+ end
52
+
data/spec/g_spec.rb ADDED
@@ -0,0 +1,36 @@
1
+ $:.unshift File.dirname(__FILE__) + '/../lib'
2
+ require 'g'
3
+
4
+ describe 'g' do
5
+ before do
6
+ @g = Object.new
7
+ Growl.should_receive(:new).and_return(@g)
8
+ end
9
+
10
+ it 'calls with a arg' do
11
+ @g.should_receive(:notify).with($0, "g", 'foo'.pretty_inspect, 0, true)
12
+ g('foo').should == 'foo'
13
+ end
14
+
15
+ it 'calls with block' do
16
+ block = Proc.new {}
17
+ @g.should_receive(:notify).with($0, "g", block.pretty_inspect, 0, true)
18
+ g(&block).should == block
19
+ end
20
+
21
+ it 'calls with args' do
22
+ block = Proc.new {}
23
+ @g.should_receive(:notify).exactly(3).times
24
+ g('foo', 1, &block).should == ['foo', 1, block]
25
+ end
26
+
27
+ it 'calls without args' do
28
+ @g.should_receive(:notify).with($0, "g", "g!", 0, true)
29
+ g.should == nil
30
+ end
31
+
32
+ it 'calls with title' do
33
+ @g.should_receive(:notify).with($0, 'bar', 'foo'.pretty_inspect, 0, true)
34
+ g('foo', :title => 'bar').should == 'foo'
35
+ end
36
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: progressions-g
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.1.test
5
+ platform: ruby
6
+ authors:
7
+ - jugyo
8
+ - Jeff Coleman
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2010-01-10 00:00:00 -06:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rspec
18
+ type: :development
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ version:
26
+ - !ruby/object:Gem::Dependency
27
+ name: ruby-growl
28
+ type: :runtime
29
+ version_requirement:
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: 1.0.1
35
+ version:
36
+ description: The Kernel.g that works like Kernel.p on growl :)
37
+ email: progressions@gmail.com
38
+ executables: []
39
+
40
+ extensions: []
41
+
42
+ extra_rdoc_files:
43
+ - README.markdown
44
+ files:
45
+ - .gitignore
46
+ - README.markdown
47
+ - Rakefile
48
+ - VERSION
49
+ - lib/g.rb
50
+ - progressions-g.gemspec
51
+ - spec/g_spec.rb
52
+ has_rdoc: true
53
+ homepage: http://github.com/progressions/g
54
+ licenses: []
55
+
56
+ post_install_message:
57
+ rdoc_options:
58
+ - --charset=UTF-8
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ version:
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">"
70
+ - !ruby/object:Gem::Version
71
+ version: 1.3.1
72
+ version:
73
+ requirements: []
74
+
75
+ rubyforge_project:
76
+ rubygems_version: 1.3.5
77
+ signing_key:
78
+ specification_version: 3
79
+ summary: g is like p
80
+ test_files:
81
+ - spec/g_spec.rb