g 1.4.0 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (7) hide show
  1. data/Gemfile +4 -0
  2. data/Rakefile +6 -22
  3. data/g.gemspec +14 -14
  4. data/lib/g.rb +4 -3
  5. data/spec/g_spec.rb +4 -9
  6. metadata +41 -57
  7. data/VERSION +0 -1
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in g.gemspec
4
+ gemspec
data/Rakefile CHANGED
@@ -1,25 +1,9 @@
1
- require 'rubygems'
2
- require 'rake'
1
+ require "bundler/gem_tasks"
3
2
 
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = "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 = "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
- 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
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 = 'g'
3
- s.version = '1.2.0'
4
- s.summary = "The Kernel.g that works like Kernel.p on growl :)"
5
- s.description = "The Kernel.g that works like Kernel.p on growl :)"
6
- s.files = %w( lib/g.rb
7
- spec/g_spec.rb
8
- README.markdown
9
- Rakefile )
10
- s.add_dependency("ruby-growl", ">= 1.0.1")
11
- s.author = 'jugyo'
12
- s.email = 'jugyo.org@gmail.com'
13
- s.homepage = 'http://github.com/jugyo/g'
14
- s.rubyforge_project = 'kernelg'
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 'ruby-growl'
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
@@ -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
- @g.should_receive(:notify).with($0, "g", 'foo'.pretty_inspect, 0, true)
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
- @g.should_receive(:notify).with($0, "g", block.pretty_inspect, 0, true)
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
- @g.should_receive(:notify).exactly(3).times
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
- @g.should_receive(:notify).with($0, "g", "g!", 0, true)
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.4.0
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
- date: 2010-01-24 00:00:00 +09:00
13
- default_executable:
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: rspec
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
20
- requirements:
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
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
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
- extra_rdoc_files:
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
- - --charset=UTF-8
59
- require_paths:
43
+ rdoc_options: []
44
+ require_paths:
60
45
  - 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: "0"
72
- version:
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
- rubyforge_project:
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 is like p
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