toclip 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,22 @@
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
22
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in open_as_text.gemspec
4
+ gemspec
data/Rakefile CHANGED
@@ -1,36 +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 = "toclip"
8
- gem.summary = %Q{Object#to_clip}
9
- gem.description = %Q{An object to the Clipboard.}
10
- gem.email = "jugyo.org@gmail.com"
11
- gem.homepage = "http://github.com/jugyo/toclip"
12
- gem.authors = ["jugyo"]
13
- gem.add_runtime_dependency "clipboard", ">= 0"
14
- gem.add_development_dependency "rspec", ">= 1.2.9"
15
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
- end
17
- Jeweler::GemcutterTasks.new
18
- rescue LoadError
19
- puts "Jeweler (or a dependency) not available. Install it with: 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']
20
7
  end
21
8
 
22
- require 'spec/rake/spectask'
23
- Spec::Rake::SpecTask.new(:spec) do |spec|
24
- spec.libs << 'lib' << 'spec'
25
- spec.spec_files = FileList['spec/**/*_spec.rb']
26
- end
27
-
28
- Spec::Rake::SpecTask.new(:rcov) do |spec|
29
- spec.libs << 'lib' << 'spec'
30
- spec.pattern = 'spec/**/*_spec.rb'
31
- spec.rcov = true
32
- end
33
-
34
- task :spec => :check_dependencies
35
-
36
9
  task :default => :spec
@@ -1,9 +1,10 @@
1
1
  require 'clipboard'
2
2
 
3
3
  module ToClip
4
- def to_clip
5
- Clipboard.copy is_a?(String) ? self : self.inspect
6
- self
4
+ def to_clip(object = nil)
5
+ object = object || self
6
+ Clipboard.copy object.is_a?(String) ? object : object.inspect
7
+ object
7
8
  end
8
9
  alias_method :toclip, :to_clip
9
10
  end
@@ -1,9 +1,8 @@
1
1
  $LOAD_PATH.unshift(File.dirname(__FILE__))
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'toclip'
4
- require 'spec'
5
- require 'spec/autorun'
4
+ require 'rspec'
6
5
 
7
- Spec::Runner.configure do |config|
8
-
6
+ RSpec.configure do |config|
7
+ # see https://github.com/rspec/rspec-core/blob/master/lib/rspec/core/configuration.rb for more infomation
9
8
  end
@@ -20,4 +20,12 @@ describe "Toclip" do
20
20
  object.to_clip
21
21
  end
22
22
  end
23
+
24
+ describe "to_clip with an arg" do
25
+ it "calls Clipboard.copy with the arg" do
26
+ object = "foo"
27
+ Clipboard.should_receive(:copy).with(object)
28
+ to_clip(object)
29
+ end
30
+ end
23
31
  end
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "toclip"
6
+ s.version = "0.3.0"
7
+ s.authors = ["jugyo"]
8
+ s.email = ["jugyo.org@gmail.com"]
9
+ s.homepage = ""
10
+ s.summary = %q{Object#toclip}
11
+ s.description = %q{It sends an object to the your clipboard.}
12
+
13
+ s.rubyforge_project = "toclip"
14
+
15
+ s.files = `git ls-files`.split("\n")
16
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
+ s.require_paths = ["lib"]
19
+
20
+ # specify any dependencies here; for example:
21
+ # s.add_development_dependency "rspec"
22
+ s.add_development_dependency "rspec", "~> 2.6"
23
+ s.add_runtime_dependency "clipboard"
24
+ end
metadata CHANGED
@@ -1,101 +1,79 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: toclip
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 2
8
- - 0
9
- version: 0.2.0
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - jugyo
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-01-17 00:00:00 +09:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: clipboard
12
+ date: 2011-12-03 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rspec
16
+ requirement: &70299186540980 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '2.6'
22
+ type: :development
22
23
  prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
+ version_requirements: *70299186540980
25
+ - !ruby/object:Gem::Dependency
26
+ name: clipboard
27
+ requirement: &70299186540320 !ruby/object:Gem::Requirement
24
28
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- version: "0"
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
31
33
  type: :runtime
32
- version_requirements: *id001
33
- - !ruby/object:Gem::Dependency
34
- name: rspec
35
34
  prerelease: false
36
- requirement: &id002 !ruby/object:Gem::Requirement
37
- none: false
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- segments:
42
- - 1
43
- - 2
44
- - 9
45
- version: 1.2.9
46
- type: :development
47
- version_requirements: *id002
48
- description: An object to the Clipboard.
49
- email: jugyo.org@gmail.com
35
+ version_requirements: *70299186540320
36
+ description: It sends an object to the your clipboard.
37
+ email:
38
+ - jugyo.org@gmail.com
50
39
  executables: []
51
-
52
40
  extensions: []
53
-
54
- extra_rdoc_files:
55
- - LICENSE
56
- - README.rdoc
57
- files:
41
+ extra_rdoc_files: []
42
+ files:
58
43
  - .document
44
+ - .gitignore
45
+ - Gemfile
59
46
  - LICENSE
60
47
  - README.rdoc
61
48
  - Rakefile
62
- - VERSION
63
49
  - lib/toclip.rb
64
- - spec/spec.opts
65
50
  - spec/spec_helper.rb
66
51
  - spec/toclip_spec.rb
67
- has_rdoc: true
68
- homepage: http://github.com/jugyo/toclip
52
+ - toclip.gemspec
53
+ homepage: ''
69
54
  licenses: []
70
-
71
55
  post_install_message:
72
56
  rdoc_options: []
73
-
74
- require_paths:
57
+ require_paths:
75
58
  - lib
76
- required_ruby_version: !ruby/object:Gem::Requirement
59
+ required_ruby_version: !ruby/object:Gem::Requirement
77
60
  none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- segments:
82
- - 0
83
- version: "0"
84
- required_rubygems_version: !ruby/object:Gem::Requirement
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
65
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
66
  none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- segments:
90
- - 0
91
- version: "0"
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
92
71
  requirements: []
93
-
94
- rubyforge_project:
95
- rubygems_version: 1.3.7
72
+ rubyforge_project: toclip
73
+ rubygems_version: 1.8.11
96
74
  signing_key:
97
75
  specification_version: 3
98
- summary: Object#to_clip
99
- test_files:
76
+ summary: Object#toclip
77
+ test_files:
100
78
  - spec/spec_helper.rb
101
79
  - spec/toclip_spec.rb
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.2.0
@@ -1 +0,0 @@
1
- --color