sheet 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sheet.rb +5 -3
- data/lib/sheet/copy.rb +1 -2
- data/sheet.gemspec +2 -2
- data/spec/sheet/copy_spec.rb +1 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/lib/sheet.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
# The Sheet class allows to easily dispatch commands from the command
|
3
2
|
# line. It also provides common functionality for other classes.
|
4
3
|
|
@@ -10,7 +9,7 @@ require 'sheet/copy'
|
|
10
9
|
class Sheet
|
11
10
|
|
12
11
|
SHEETS_DIR = '~/.sheets/'.freeze
|
13
|
-
|
12
|
+
|
14
13
|
class << self
|
15
14
|
# Utility to write to standard output
|
16
15
|
def write(message)
|
@@ -34,8 +33,11 @@ class Sheet
|
|
34
33
|
end
|
35
34
|
|
36
35
|
# Where the sheets directory is (absolute path)
|
36
|
+
#
|
37
|
+
# This defaults to ~/.sheets,
|
38
|
+
# but can be overridden by the SHEETS_DIR env var
|
37
39
|
def sheets_dir
|
38
|
-
File.expand_path(SHEETS_DIR)
|
40
|
+
File.expand_path(ENV['SHEETS_DIR'] || SHEETS_DIR)
|
39
41
|
end
|
40
42
|
|
41
43
|
# @param [String] name the sheet name
|
data/lib/sheet/copy.rb
CHANGED
@@ -28,8 +28,7 @@ class Sheet
|
|
28
28
|
def copy_sheet
|
29
29
|
copy_cmd = Sheet.copy_command
|
30
30
|
if copy_cmd
|
31
|
-
Sheet.exec("cat #{Sheet::sheet_path(name)} | #{copy_cmd}")
|
32
|
-
Sheet.write("Copied!")
|
31
|
+
Sheet.exec("cat #{Sheet::sheet_path(name)} | #{copy_cmd}", true)
|
33
32
|
else
|
34
33
|
Sheet.write("Could not copy sheet, no copy command found")
|
35
34
|
end
|
data/sheet.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "sheet"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Oscar Del Ben"]
|
12
|
-
s.date = "2012-04-
|
12
|
+
s.date = "2012-04-18"
|
13
13
|
s.description = "sheets allows you to store and browse snippets of text from your command line."
|
14
14
|
s.email = "info@oscardelben.com"
|
15
15
|
s.executables = ["sheet"]
|
data/spec/sheet/copy_spec.rb
CHANGED
@@ -4,8 +4,7 @@ describe Sheet::Copy do
|
|
4
4
|
|
5
5
|
it 'should copy the snippet' do
|
6
6
|
cmd = "cat #{Sheet.sheet_path('git')} | pbcopy"
|
7
|
-
Sheet.should_receive(:exec).with(cmd)
|
8
|
-
Sheet.should_receive(:write).with("Copied!")
|
7
|
+
Sheet.should_receive(:exec).with(cmd, true)
|
9
8
|
|
10
9
|
Sheet.stub(:copy_command) { 'pbcopy' }
|
11
10
|
Sheet.stub(:sheet_exists?).with('git') { true }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sheet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -121,7 +121,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
segments:
|
123
123
|
- 0
|
124
|
-
hash:
|
124
|
+
hash: -175941379873315490
|
125
125
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
126
|
none: false
|
127
127
|
requirements:
|