docx_replace 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +1 -0
- data/docx_replace.gemspec +1 -1
- data/lib/docx_replace/version.rb +1 -1
- data/lib/docx_replace.rb +4 -4
- metadata +9 -13
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZjRmY2ZkMjA4MDA4ZjYzM2QwM2Y2OTMzNTc1MjY5YmQzNTE3OTZiYw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZGU0ODI0NzkwYzhiNDYxNzgyMmY0NTVjNTgyOWNlOGJjZjhlNDhhMg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NTRiNTQzMDkzM2JhODY3NDg0Y2FkNmFiZjc2YWNmNTA4ODNmYjgyYmUzY2Q2
|
10
|
+
ZmVjNjA5Zjk4MDViZGQzY2ExN2E1ODMyODI4YzJlMTZkYmI4OGY1MjZhYWVj
|
11
|
+
ZGIzMjk0ZjVhMjhiZmVhZDg2ZDBkZjBjZDg5YWRlNjU5NDZkZmE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTRmNjJhM2QyYjNkOWUyZjU2Njc0MTZlY2U0ZGVkN2FiOWU0NDc3N2IzYjAy
|
14
|
+
NDRmM2RlNzI1YzdjYmQ5MDg2YWJhMzQ5MzE1ZTFhMWE4NDcyYzhhZDdjMTg5
|
15
|
+
MmY3YzY4M2FkNjg5MTQxYzE0NDdkZjg2MDZlNDRkMzdjYzU0NTQ=
|
data/.gitignore
CHANGED
data/docx_replace.gemspec
CHANGED
@@ -16,5 +16,5 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
|
-
gem.add_runtime_dependency "rubyzip"
|
19
|
+
gem.add_runtime_dependency "rubyzip", "~> 1.1.0"
|
20
20
|
end
|
data/lib/docx_replace/version.rb
CHANGED
data/lib/docx_replace.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
require "docx_replace/version"
|
2
|
-
require 'zip
|
2
|
+
require 'zip'
|
3
3
|
require 'tempfile'
|
4
4
|
|
5
5
|
module DocxReplace
|
6
6
|
class Doc
|
7
7
|
def initialize(path, temp_dir=nil)
|
8
|
-
@zip_file = Zip::
|
8
|
+
@zip_file = Zip::File.new(path)
|
9
9
|
@temp_dir = temp_dir
|
10
10
|
read_docx_file
|
11
11
|
end
|
@@ -35,7 +35,7 @@ module DocxReplace
|
|
35
35
|
else
|
36
36
|
temp_file = Tempfile.new('docxedit-', @temp_dir)
|
37
37
|
end
|
38
|
-
Zip::
|
38
|
+
Zip::OutputStream.open(temp_file.path) do |zos|
|
39
39
|
@zip_file.entries.each do |e|
|
40
40
|
unless e.name == DOCUMENT_FILE_PATH
|
41
41
|
zos.put_next_entry(e.name)
|
@@ -54,7 +54,7 @@ module DocxReplace
|
|
54
54
|
path = new_path
|
55
55
|
end
|
56
56
|
FileUtils.mv(temp_file.path, path)
|
57
|
-
@zip_file = Zip::
|
57
|
+
@zip_file = Zip::File.new(path)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
metadata
CHANGED
@@ -1,32 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: docx_replace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Adam Albrecht
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-04
|
11
|
+
date: 2013-12-04 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rubyzip
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ~>
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: 1.1.0
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ~>
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: 1.1.0
|
30
27
|
description: Find and replace variables inside a Micorsoft Word (.docx) template
|
31
28
|
email:
|
32
29
|
- adam.albrecht@gmail.com
|
@@ -45,26 +42,25 @@ files:
|
|
45
42
|
- lib/docx_replace/version.rb
|
46
43
|
homepage: https://github.com/adamalbrecht/docx_replace
|
47
44
|
licenses: []
|
45
|
+
metadata: {}
|
48
46
|
post_install_message:
|
49
47
|
rdoc_options: []
|
50
48
|
require_paths:
|
51
49
|
- lib
|
52
50
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
-
none: false
|
54
51
|
requirements:
|
55
52
|
- - ! '>='
|
56
53
|
- !ruby/object:Gem::Version
|
57
54
|
version: '0'
|
58
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
|
-
none: false
|
60
56
|
requirements:
|
61
57
|
- - ! '>='
|
62
58
|
- !ruby/object:Gem::Version
|
63
59
|
version: '0'
|
64
60
|
requirements: []
|
65
61
|
rubyforge_project:
|
66
|
-
rubygems_version: 1.
|
62
|
+
rubygems_version: 2.1.10
|
67
63
|
signing_key:
|
68
|
-
specification_version:
|
64
|
+
specification_version: 4
|
69
65
|
summary: Find and replace variables inside a Micorsoft Word (.docx) template
|
70
66
|
test_files: []
|