copyrb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Rakefile +1 -1
  2. data/VERSION +1 -1
  3. data/copyrb.gemspec +64 -0
  4. data/lib/copyrb.rb +4 -3
  5. metadata +4 -17
data/Rakefile CHANGED
@@ -21,7 +21,7 @@ Jeweler::Tasks.new do |gem|
21
21
  gem.authors = ["Milan Dobrota"]
22
22
  # Include your dependencies below. Runtime dependencies are required when using your gem,
23
23
  # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
- gem.add_runtime_dependency 'json' #, '> 0.1'
24
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
25
  # gem.add_development_dependency 'rspec', '> 1.2.3'
26
26
  end
27
27
  Jeweler::RubygemsDotOrgTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
data/copyrb.gemspec ADDED
@@ -0,0 +1,64 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{copyrb}
8
+ s.version = "0.0.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Milan Dobrota"]
12
+ s.date = %q{2011-01-15}
13
+ s.description = %q{Copy and paste ruby objects across terminals}
14
+ s.email = %q{milan@milandobrota.com}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE.txt",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "copyrb.gemspec",
28
+ "lib/copyrb.rb",
29
+ "test/helper.rb",
30
+ "test/test_copyrb.rb"
31
+ ]
32
+ s.homepage = %q{http://github.com/milandobrota/copyrb}
33
+ s.licenses = ["MIT"]
34
+ s.require_paths = ["lib"]
35
+ s.rubygems_version = %q{1.3.7}
36
+ s.summary = %q{Ruby objects to go}
37
+ s.test_files = [
38
+ "test/helper.rb",
39
+ "test/test_copyrb.rb"
40
+ ]
41
+
42
+ if s.respond_to? :specification_version then
43
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
48
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
49
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
50
+ s.add_development_dependency(%q<rcov>, [">= 0"])
51
+ else
52
+ s.add_dependency(%q<shoulda>, [">= 0"])
53
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
54
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
55
+ s.add_dependency(%q<rcov>, [">= 0"])
56
+ end
57
+ else
58
+ s.add_dependency(%q<shoulda>, [">= 0"])
59
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
61
+ s.add_dependency(%q<rcov>, [">= 0"])
62
+ end
63
+ end
64
+
data/lib/copyrb.rb CHANGED
@@ -1,12 +1,13 @@
1
- require 'json'
1
+ require 'yaml'
2
+ require 'base64'
2
3
 
3
4
  def copy(obj)
4
- text = obj.to_json
5
+ text = Base64.encode64(YAML.dump(obj)).gsub("\n", '') # getting rid of nonmeaningful new lines
5
6
  IO.popen('pbcopy', 'r+') { |clipboard| clipboard.puts text }
6
7
  end
7
8
 
8
9
  def paste
9
10
  text = IO.popen('pbpaste', 'r+') { |clipboard| clipboard.gets }
10
- JSON.parse(text)
11
+ YAML.load(Base64.decode64(text))
11
12
  end
12
13
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copyrb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Milan Dobrota
@@ -78,20 +78,6 @@ dependencies:
78
78
  - 0
79
79
  version: "0"
80
80
  requirement: *id004
81
- - !ruby/object:Gem::Dependency
82
- prerelease: false
83
- type: :runtime
84
- name: json
85
- version_requirements: &id005 !ruby/object:Gem::Requirement
86
- none: false
87
- requirements:
88
- - - ">="
89
- - !ruby/object:Gem::Version
90
- hash: 3
91
- segments:
92
- - 0
93
- version: "0"
94
- requirement: *id005
95
81
  description: Copy and paste ruby objects across terminals
96
82
  email: milan@milandobrota.com
97
83
  executables: []
@@ -109,6 +95,7 @@ files:
109
95
  - README.rdoc
110
96
  - Rakefile
111
97
  - VERSION
98
+ - copyrb.gemspec
112
99
  - lib/copyrb.rb
113
100
  - test/helper.rb
114
101
  - test/test_copyrb.rb