g 1.4.0 → 1.5.0
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/Gemfile +4 -0
- data/Rakefile +6 -22
- data/g.gemspec +14 -14
- data/lib/g.rb +4 -3
- data/spec/g_spec.rb +4 -9
- metadata +41 -57
- data/VERSION +0 -1
data/Gemfile
ADDED
data/Rakefile
CHANGED
@@ -1,25 +1,9 @@
|
|
1
|
-
require
|
2
|
-
require 'rake'
|
1
|
+
require "bundler/gem_tasks"
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
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 = "jugyo.org@gmail.com"
|
11
|
-
gem.homepage = "http://github.com/jugyo/g"
|
12
|
-
gem.authors = ["jugyo"]
|
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"
|
3
|
+
require 'rspec/core'
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
6
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
18
7
|
end
|
19
8
|
|
20
|
-
|
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
|
9
|
+
task :default => :spec
|
data/g.gemspec
CHANGED
@@ -1,16 +1,16 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
1
2
|
Gem::Specification.new do |s|
|
2
|
-
s.name
|
3
|
-
s.version
|
4
|
-
s.
|
5
|
-
s.
|
6
|
-
s.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
s.
|
15
|
-
s.has_rdoc = false
|
3
|
+
s.name = "g"
|
4
|
+
s.version = "1.5.0"
|
5
|
+
s.authors = ["jugyo"]
|
6
|
+
s.email = ["jugyo.org@gmail.com"]
|
7
|
+
s.homepage = "http://github.com/jugyo/g"
|
8
|
+
s.summary = %q{The Kernel.g}
|
9
|
+
s.description = %q{It works like Kernel.p with growl :)}
|
10
|
+
s.rubyforge_project = "g"
|
11
|
+
s.files = `git ls-files`.split("\n")
|
12
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
13
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
14
|
+
s.require_paths = ["lib"]
|
15
|
+
s.add_runtime_dependency "ruby_gntp"
|
16
16
|
end
|
data/lib/g.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
2
|
+
require 'ruby_gntp'
|
3
3
|
require 'pp'
|
4
4
|
|
5
5
|
$g_host ||= "localhost"
|
@@ -8,7 +8,7 @@ $g_sticky ||= true
|
|
8
8
|
|
9
9
|
module Kernel
|
10
10
|
def g(*args, &block)
|
11
|
-
growl = Growl.new $g_host, 'g', [$0]
|
11
|
+
# growl = Growl.new $g_host, 'g', [$0]
|
12
12
|
|
13
13
|
args.push(block) if block
|
14
14
|
|
@@ -19,7 +19,8 @@ module Kernel
|
|
19
19
|
args.map { |i| i.pretty_inspect }
|
20
20
|
end
|
21
21
|
|
22
|
-
messages.each { |i| growl.notify $0, 'g', i, $g_priority, $g_sticky }
|
22
|
+
# messages.each { |i| growl.notify $0, 'g', i, $g_priority, $g_sticky }
|
23
|
+
messages.each { |i| GNTP.notify :app_name => $0, :title => 'g', :text => i, :sticky => $g_sticky }
|
23
24
|
|
24
25
|
if args.empty?
|
25
26
|
nil
|
data/spec/g_spec.rb
CHANGED
@@ -2,30 +2,25 @@ $:.unshift File.dirname(__FILE__) + '/../lib'
|
|
2
2
|
require 'g'
|
3
3
|
|
4
4
|
describe 'g' do
|
5
|
-
before do
|
6
|
-
@g = Object.new
|
7
|
-
Growl.should_receive(:new).and_return(@g)
|
8
|
-
end
|
9
|
-
|
10
5
|
it 'calls with a arg' do
|
11
|
-
|
6
|
+
GNTP.should_receive(:notify).with(:app_name => $0, :title => "g", :text => "foo".pretty_inspect, :sticky=>true)
|
12
7
|
g('foo').should == 'foo'
|
13
8
|
end
|
14
9
|
|
15
10
|
it 'calls with block' do
|
16
11
|
block = Proc.new {}
|
17
|
-
|
12
|
+
GNTP.should_receive(:notify).with(:app_name => $0, :title => "g", :text => block.pretty_inspect, :sticky=>true)
|
18
13
|
g(&block).should == block
|
19
14
|
end
|
20
15
|
|
21
16
|
it 'calls with args' do
|
22
17
|
block = Proc.new {}
|
23
|
-
|
18
|
+
GNTP.should_receive(:notify).exactly(3).times
|
24
19
|
g('foo', 1, &block).should == ['foo', 1, block]
|
25
20
|
end
|
26
21
|
|
27
22
|
it 'calls without args' do
|
28
|
-
|
23
|
+
GNTP.should_receive(:notify).with(:app_name => $0, :title => "g", :text => "g!", :sticky=>true)
|
29
24
|
g.should == nil
|
30
25
|
end
|
31
26
|
end
|
metadata
CHANGED
@@ -1,81 +1,65 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: g
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.5.0
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
+
authors:
|
7
8
|
- jugyo
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
- - ">="
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: "0"
|
24
|
-
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: ruby-growl
|
12
|
+
date: 2011-11-14 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ruby_gntp
|
16
|
+
requirement: &2169115360 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
27
22
|
type: :runtime
|
28
|
-
|
29
|
-
version_requirements:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
version: 1.0.1
|
34
|
-
version:
|
35
|
-
description: The Kernel.g that works like Kernel.p on growl :)
|
36
|
-
email: jugyo.org@gmail.com
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *2169115360
|
25
|
+
description: It works like Kernel.p with growl :)
|
26
|
+
email:
|
27
|
+
- jugyo.org@gmail.com
|
37
28
|
executables: []
|
38
|
-
|
39
29
|
extensions: []
|
40
|
-
|
41
|
-
|
42
|
-
- README.markdown
|
43
|
-
files:
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
44
32
|
- .gitignore
|
33
|
+
- Gemfile
|
45
34
|
- README.markdown
|
46
35
|
- Rakefile
|
47
|
-
- VERSION
|
48
36
|
- g.gemspec
|
49
37
|
- lib/g.rb
|
50
38
|
- lib/md5.rb
|
51
39
|
- spec/g_spec.rb
|
52
|
-
has_rdoc: true
|
53
40
|
homepage: http://github.com/jugyo/g
|
54
41
|
licenses: []
|
55
|
-
|
56
42
|
post_install_message:
|
57
|
-
rdoc_options:
|
58
|
-
|
59
|
-
require_paths:
|
43
|
+
rdoc_options: []
|
44
|
+
require_paths:
|
60
45
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
46
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
47
|
+
none: false
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ! '>='
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '0'
|
73
58
|
requirements: []
|
74
|
-
|
75
|
-
|
76
|
-
rubygems_version: 1.3.5
|
59
|
+
rubyforge_project: g
|
60
|
+
rubygems_version: 1.8.11
|
77
61
|
signing_key:
|
78
62
|
specification_version: 3
|
79
|
-
summary: g
|
80
|
-
test_files:
|
63
|
+
summary: The Kernel.g
|
64
|
+
test_files:
|
81
65
|
- spec/g_spec.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.4.0
|