toclip 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/Rakefile +1 -1
  2. data/VERSION +1 -1
  3. data/lib/toclip.rb +3 -2
  4. data/spec/toclip_spec.rb +15 -1
  5. metadata +15 -16
  6. data/.gitignore +0 -21
data/Rakefile CHANGED
@@ -10,8 +10,8 @@ begin
10
10
  gem.email = "jugyo.org@gmail.com"
11
11
  gem.homepage = "http://github.com/jugyo/toclip"
12
12
  gem.authors = ["jugyo"]
13
+ gem.add_runtime_dependency "clipboard", ">= 0"
13
14
  gem.add_development_dependency "rspec", ">= 1.2.9"
14
- gem.add_dependency "pb", ">= 0"
15
15
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
16
  end
17
17
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
data/lib/toclip.rb CHANGED
@@ -1,10 +1,11 @@
1
- require 'pb'
1
+ require 'clipboard'
2
2
 
3
3
  module ToClip
4
4
  def to_clip
5
- PB.copy self.inspect
5
+ Clipboard.copy is_a?(String) ? self : self.inspect
6
6
  self
7
7
  end
8
+ alias_method :toclip, :to_clip
8
9
  end
9
10
 
10
11
  Object.send(:include, ToClip)
data/spec/toclip_spec.rb CHANGED
@@ -3,7 +3,21 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
3
3
  describe "Toclip" do
4
4
  it "should clip" do
5
5
  object = Object.new
6
- PB.should_receive(:copy).with(object.inspect)
6
+ Clipboard.should_receive(:copy).with(object.inspect)
7
7
  object.to_clip.should == object
8
8
  end
9
+
10
+ it "alias_method :toclip, :to_clip" do
11
+ object = Object.new
12
+ Clipboard.should_receive(:copy).with(object.inspect)
13
+ object.toclip.should == object
14
+ end
15
+
16
+ describe "String#to_clip" do
17
+ it "should not call inspect" do
18
+ object = "foo"
19
+ Clipboard.should_receive(:copy).with(object)
20
+ object.to_clip
21
+ end
22
+ end
9
23
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
7
+ - 2
8
8
  - 0
9
- version: 0.1.0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - jugyo
@@ -14,11 +14,11 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-09-09 00:00:00 +09:00
17
+ date: 2011-01-17 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: rspec
21
+ name: clipboard
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
@@ -26,14 +26,12 @@ dependencies:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  segments:
29
- - 1
30
- - 2
31
- - 9
32
- version: 1.2.9
33
- type: :development
29
+ - 0
30
+ version: "0"
31
+ type: :runtime
34
32
  version_requirements: *id001
35
33
  - !ruby/object:Gem::Dependency
36
- name: pb
34
+ name: rspec
37
35
  prerelease: false
38
36
  requirement: &id002 !ruby/object:Gem::Requirement
39
37
  none: false
@@ -41,9 +39,11 @@ dependencies:
41
39
  - - ">="
42
40
  - !ruby/object:Gem::Version
43
41
  segments:
44
- - 0
45
- version: "0"
46
- type: :runtime
42
+ - 1
43
+ - 2
44
+ - 9
45
+ version: 1.2.9
46
+ type: :development
47
47
  version_requirements: *id002
48
48
  description: An object to the Clipboard.
49
49
  email: jugyo.org@gmail.com
@@ -56,7 +56,6 @@ extra_rdoc_files:
56
56
  - README.rdoc
57
57
  files:
58
58
  - .document
59
- - .gitignore
60
59
  - LICENSE
61
60
  - README.rdoc
62
61
  - Rakefile
@@ -70,8 +69,8 @@ homepage: http://github.com/jugyo/toclip
70
69
  licenses: []
71
70
 
72
71
  post_install_message:
73
- rdoc_options:
74
- - --charset=UTF-8
72
+ rdoc_options: []
73
+
75
74
  require_paths:
76
75
  - lib
77
76
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC