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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZjRmY2ZkMjA4MDA4ZjYzM2QwM2Y2OTMzNTc1MjY5YmQzNTE3OTZiYw==
4
+ ZTg1MmMyNDViZWI2NGMzZjZhZDc4ZDQwNGUzZTcyNDI2M2IwNDg4OA==
5
5
  data.tar.gz: !binary |-
6
- ZGU0ODI0NzkwYzhiNDYxNzgyMmY0NTVjNTgyOWNlOGJjZjhlNDhhMg==
6
+ MTE5YzQ3YWFkMDFjYWQ1ZTliNmFkZDBlYzkyZDIyZWViMzU3ZmQ0Mg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTRiNTQzMDkzM2JhODY3NDg0Y2FkNmFiZjc2YWNmNTA4ODNmYjgyYmUzY2Q2
10
- ZmVjNjA5Zjk4MDViZGQzY2ExN2E1ODMyODI4YzJlMTZkYmI4OGY1MjZhYWVj
11
- ZGIzMjk0ZjVhMjhiZmVhZDg2ZDBkZjBjZDg5YWRlNjU5NDZkZmE=
9
+ YmJmNTA1NDQwMzMzZDMxOWJkMzcyODRkYjhkZTYyOWViYThmY2ViZWYzNzc2
10
+ YmRmMjFhNjMzOTY5MzBjZjUxNWVjM2FhNGYyNWYzMWIyODE0NDkzZWIxZmE5
11
+ ZDdkODZmMDAzYzI5NWNiY2U3MzM2ZDNiNzY1ZTA0ZmQzNGZiN2U=
12
12
  data.tar.gz: !binary |-
13
- OTRmNjJhM2QyYjNkOWUyZjU2Njc0MTZlY2U0ZGVkN2FiOWU0NDc3N2IzYjAy
14
- NDRmM2RlNzI1YzdjYmQ5MDg2YWJhMzQ5MzE1ZTFhMWE4NDcyYzhhZDdjMTg5
15
- MmY3YzY4M2FkNjg5MTQxYzE0NDdkZjg2MDZlNDRkMzdjYzU0NTQ=
13
+ ZjEyNDJiMzNhYjc5MTEyNGFmNWU4NzhmMDhmNDhjOGFjYzU2MmNiNzQ2MWM1
14
+ MTdmNTVlODJhM2U3MWEwM2NkNWFkNzA2NjAzODY4MzA4ODJlZGIyMDhhNmNm
15
+ NjcwNjJkYjMwNWRkN2U3OTI1Nzk4MDE5ZWNiMDU4ZDYyMTgwMTg=
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ test/tmp
16
16
  test/version_tmp
17
17
  tmp
18
18
  *.swp
19
+ .DS_Store
@@ -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) }
@@ -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
@@ -1,3 +1,3 @@
1
1
  module DocxReplace
2
- VERSION = "1.0.1"
2
+ VERSION = "1.0.2"
3
3
  end
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.1
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: 2013-12-04 00:00:00.000000000 Z
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: []