docx_replace 1.0.1 → 1.0.2
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 +8 -8
- data/.gitignore +1 -0
- data/docx_replace.gemspec +1 -0
- data/lib/docx_replace.rb +11 -0
- data/lib/docx_replace/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZTg1MmMyNDViZWI2NGMzZjZhZDc4ZDQwNGUzZTcyNDI2M2IwNDg4OA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MTE5YzQ3YWFkMDFjYWQ1ZTliNmFkZDBlYzkyZDIyZWViMzU3ZmQ0Mg==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
YmJmNTA1NDQwMzMzZDMxOWJkMzcyODRkYjhkZTYyOWViYThmY2ViZWYzNzc2
|
|
10
|
+
YmRmMjFhNjMzOTY5MzBjZjUxNWVjM2FhNGYyNWYzMWIyODE0NDkzZWIxZmE5
|
|
11
|
+
ZDdkODZmMDAzYzI5NWNiY2U3MzM2ZDNiNzY1ZTA0ZmQzNGZiN2U=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ZjEyNDJiMzNhYjc5MTEyNGFmNWU4NzhmMDhmNDhjOGFjYzU2MmNiNzQ2MWM1
|
|
14
|
+
MTdmNTVlODJhM2U3MWEwM2NkNWFkNzA2NjAzODY4MzA4ODJlZGIyMDhhNmNm
|
|
15
|
+
NjcwNjJkYjMwNWRkN2U3OTI1Nzk4MDE5ZWNiMDU4ZDYyMTgwMTg=
|
data/.gitignore
CHANGED
data/docx_replace.gemspec
CHANGED
|
@@ -11,6 +11,7 @@ Gem::Specification.new do |gem|
|
|
|
11
11
|
gem.description = %q{Find and replace variables inside a Micorsoft Word (.docx) template}
|
|
12
12
|
gem.summary = %q{Find and replace variables inside a Micorsoft Word (.docx) template}
|
|
13
13
|
gem.homepage = "https://github.com/adamalbrecht/docx_replace"
|
|
14
|
+
gem.license = "MIT"
|
|
14
15
|
|
|
15
16
|
gem.files = `git ls-files`.split($/)
|
|
16
17
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/docx_replace.rb
CHANGED
|
@@ -18,6 +18,17 @@ module DocxReplace
|
|
|
18
18
|
end
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
+
def matches(pattern)
|
|
22
|
+
@document_content.scan(pattern).map{|match| match.first}
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def unique_matches(pattern)
|
|
26
|
+
matches(pattern)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
alias_method :uniq_matches, :unique_matches
|
|
30
|
+
|
|
31
|
+
|
|
21
32
|
def commit(new_path=nil)
|
|
22
33
|
write_back_to_file(new_path)
|
|
23
34
|
end
|
data/lib/docx_replace/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: docx_replace
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Adam Albrecht
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rubyzip
|
|
@@ -41,7 +41,8 @@ files:
|
|
|
41
41
|
- lib/docx_replace.rb
|
|
42
42
|
- lib/docx_replace/version.rb
|
|
43
43
|
homepage: https://github.com/adamalbrecht/docx_replace
|
|
44
|
-
licenses:
|
|
44
|
+
licenses:
|
|
45
|
+
- MIT
|
|
45
46
|
metadata: {}
|
|
46
47
|
post_install_message:
|
|
47
48
|
rdoc_options: []
|