irbtab 0.0.8 → 0.0.9
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/irbtab.gemspec +1 -1
- data/lib/irbtab.rb +6 -4
- metadata +4 -4
data/irbtab.gemspec
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification::new do |spec|
|
|
4
4
|
spec.name = "irbtab"
|
|
5
|
-
spec.version = "0.0.
|
|
5
|
+
spec.version = "0.0.9"
|
|
6
6
|
spec.platform = Gem::Platform::RUBY
|
|
7
7
|
spec.summary = "copy and paste between spreadsheet and ruby arrays in irb"
|
|
8
8
|
spec.description = "copy and paste between ruby arrays in irb/rails console and a spreadsheet (tab delimited) and vise versa. Based on irbcp by Ara T. Howard"
|
data/lib/irbtab.rb
CHANGED
|
@@ -9,7 +9,7 @@ end
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
module Irbtab
|
|
12
|
-
Version = '0.0.
|
|
12
|
+
Version = '0.0.9'
|
|
13
13
|
|
|
14
14
|
def Irbtab.version() Irbtab::Version end
|
|
15
15
|
|
|
@@ -33,11 +33,10 @@ module Irbtab
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def copy(args)
|
|
36
|
+
raise ArgumentError.new("Two dimentional array required") unless args.first.kind_of?(Array)
|
|
36
37
|
stdin = CSV.generate({:col_sep => "\t"}) do |csv|
|
|
37
38
|
args.each { |i| csv << i }
|
|
38
39
|
end
|
|
39
|
-
|
|
40
|
-
|
|
41
40
|
systemu(Copy, :stdin => stdin)
|
|
42
41
|
stdin
|
|
43
42
|
end
|
|
@@ -52,6 +51,9 @@ module Irbtab
|
|
|
52
51
|
args.size==0 ? paste(*args) : copy(*args)
|
|
53
52
|
end
|
|
54
53
|
|
|
54
|
+
# alias for irbt
|
|
55
|
+
alias :irbtab :irbt
|
|
56
|
+
|
|
55
57
|
|
|
56
58
|
extend(self)
|
|
57
59
|
end
|
|
@@ -60,7 +62,7 @@ IrbTab = Irbtab
|
|
|
60
62
|
|
|
61
63
|
module Kernel
|
|
62
64
|
private
|
|
63
|
-
%w( copy paste irbt ).each do |method|
|
|
65
|
+
%w( copy paste irbt irbtab).each do |method|
|
|
64
66
|
module_eval <<-__
|
|
65
67
|
def #{ method }(*args, &block)
|
|
66
68
|
Irbtab.#{ method }(*args, &block)
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: irbtab
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 13
|
|
5
5
|
prerelease:
|
|
6
6
|
segments:
|
|
7
7
|
- 0
|
|
8
8
|
- 0
|
|
9
|
-
-
|
|
10
|
-
version: 0.0.
|
|
9
|
+
- 9
|
|
10
|
+
version: 0.0.9
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- Mark Suppes
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2013-
|
|
19
|
+
date: 2013-03-25 00:00:00 Z
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
22
22
|
name: systemu
|