expd 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -1
- data.tar.gz.sig +0 -0
- data/bin/expd +2 -2
- data/lib/expd/config.rb +5 -0
- data/lib/expd/version.rb +2 -1
- metadata +15 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 724a63081a251c28ffb2a243805d5ab9d9303a6f
|
|
4
|
+
data.tar.gz: 421b33d7bd72a5653d134ac892768dc91be3219e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dc5201f0642dbc88b12658ac1fb7660874e42f0f54c1e2c72853126837500d5768f19cae2cb1cbddf6a7b9289ca3b34bfcc886d11ee9fdbbe56372271fb61576
|
|
7
|
+
data.tar.gz: 2dea79b585919831443caedca5be9b5bc372f110be2dce5a824c49f6364f5d65816b55b15c6a89b5fab7b49b2e9646c73ea423936fd6de13fc9821921ba5ef47
|
checksums.yaml.gz.sig
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
�
|
|
1
|
+
[Oǧ�w��z��`�&,�"6n�w.�9����Gx�#���z��J �m"�m#�=b$[�L�3I��C�GU� ,Ϙ��"y0�-#q�)�ha��>j��lRH�3��^�&���y�.��fb�ؖ�҅����p�D
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/bin/expd
CHANGED
|
@@ -30,9 +30,9 @@ unless opts[:remove] || opts[:add]
|
|
|
30
30
|
puts s unless s.empty?
|
|
31
31
|
else
|
|
32
32
|
if opts[:remove]
|
|
33
|
-
conf.delete word
|
|
33
|
+
conf.snippets.delete word
|
|
34
34
|
elsif opts[:add]
|
|
35
|
-
conf
|
|
35
|
+
conf.snippets[word] = STDIN.read
|
|
36
36
|
end
|
|
37
37
|
conf.save!
|
|
38
38
|
end
|
data/lib/expd/config.rb
CHANGED
|
@@ -13,19 +13,24 @@ module Expd
|
|
|
13
13
|
load_from_file!
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
# Load the configuration from its file if it exists. This already performed
|
|
17
|
+
# on instance creation.
|
|
16
18
|
def load_from_file!
|
|
17
19
|
@conf = YAML.load_file @filename if File.exist?(@filename)
|
|
18
20
|
@conf[:snippets] ||= {}
|
|
19
21
|
end
|
|
20
22
|
|
|
23
|
+
# Save the configuration on disk
|
|
21
24
|
def save!
|
|
22
25
|
File.open(@filename, "w") { |f| f.write YAML.dump(@conf) }
|
|
23
26
|
end
|
|
24
27
|
|
|
28
|
+
# Shortcut to get the snippets
|
|
25
29
|
def snippets
|
|
26
30
|
self[:snippets]
|
|
27
31
|
end
|
|
28
32
|
|
|
33
|
+
# Return a configuration loaded from the default config file
|
|
29
34
|
def self.defaults
|
|
30
35
|
new File.expand_path("~/.expd_snippets")
|
|
31
36
|
end
|
data/lib/expd/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: expd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Baptiste Fontaine
|
|
@@ -88,6 +88,20 @@ dependencies:
|
|
|
88
88
|
- - "~>"
|
|
89
89
|
- !ruby/object:Gem::Version
|
|
90
90
|
version: '0.8'
|
|
91
|
+
- !ruby/object:Gem::Dependency
|
|
92
|
+
name: test-unit
|
|
93
|
+
requirement: !ruby/object:Gem::Requirement
|
|
94
|
+
requirements:
|
|
95
|
+
- - "~>"
|
|
96
|
+
- !ruby/object:Gem::Version
|
|
97
|
+
version: '2.5'
|
|
98
|
+
type: :development
|
|
99
|
+
prerelease: false
|
|
100
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
101
|
+
requirements:
|
|
102
|
+
- - "~>"
|
|
103
|
+
- !ruby/object:Gem::Version
|
|
104
|
+
version: '2.5'
|
|
91
105
|
description: Expand text snippet from simple shortcuts on the command-line
|
|
92
106
|
email: batifon@yahoo.fr
|
|
93
107
|
executables:
|
metadata.gz.sig
CHANGED
|
Binary file
|