docx_generator 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +18 -18
- data/.rspec +1 -0
- data/Gemfile +6 -4
- data/Guardfile +11 -11
- data/LICENSE.txt +22 -22
- data/README.md +41 -41
- data/Rakefile +7 -7
- data/docx_generator.gemspec +36 -36
- data/examples/basic_document_with_blocks.rb +40 -36
- data/examples/basic_document_without_blocks.rb +9 -9
- data/generators.thor +10 -0
- data/generators/word_base.rb +106 -0
- data/lib/docx_generator.rb +9 -9
- data/lib/docx_generator/dsl.rb +9 -9
- data/lib/docx_generator/dsl/document.rb +84 -75
- data/lib/docx_generator/dsl/paragraph.rb +125 -72
- data/lib/docx_generator/dsl/text.rb +121 -71
- data/lib/docx_generator/element.rb +52 -52
- data/lib/docx_generator/version.rb +4 -4
- data/lib/docx_generator/word.rb +8 -8
- data/lib/docx_generator/word/base.rb +83 -82
- data/lib/docx_generator/word/extensions.rb +30 -18
- data/lib/docx_generator/word/formatting.rb +162 -58
- data/spec/docx_generator/dsl/document_spec.rb +89 -89
- data/spec/docx_generator/dsl/paragraph_spec.rb +107 -71
- data/spec/docx_generator/dsl/text_spec.rb +91 -65
- data/spec/docx_generator/element_spec.rb +44 -44
- data/spec/docx_generator/word/base_spec.rb +57 -57
- data/spec/docx_generator/word/extensions_spec.rb +15 -15
- data/spec/docx_generator/word/formatting_spec.rb +89 -41
- data/spec/spec_helper.rb +7 -7
- metadata +29 -55
- data/.rvmrc +0 -60
data/.rvmrc
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
-
# development environment upon cd'ing into the directory
|
5
|
-
|
6
|
-
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
-
# Only full ruby name is supported here, for short names use:
|
8
|
-
# echo "rvm use 2.0.0" > .rvmrc
|
9
|
-
environment_id="ruby-2.0.0-p0@docx_generator"
|
10
|
-
|
11
|
-
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
-
# rvmrc_rvm_version="1.20.5 (stable)" # 1.10.1 seams as a safe start
|
13
|
-
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
-
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
-
# return 1
|
16
|
-
# }
|
17
|
-
|
18
|
-
# First we attempt to load the desired environment directly from the environment
|
19
|
-
# file. This is very fast and efficient compared to running through the entire
|
20
|
-
# CLI and selector. If you want feedback on which environment was used then
|
21
|
-
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
-
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
-
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
-
then
|
25
|
-
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
-
for __hook in "${rvm_path:-$HOME/.rvm}/hooks/after_use"*
|
27
|
-
do
|
28
|
-
if [[ -f "${__hook}" && -x "${__hook}" && -s "${__hook}" ]]
|
29
|
-
then \. "${__hook}" || true
|
30
|
-
fi
|
31
|
-
done
|
32
|
-
unset __hook
|
33
|
-
if (( ${rvm_use_flag:=1} >= 2 )) # display only when forced
|
34
|
-
then
|
35
|
-
if [[ $- == *i* ]] # check for interactive shells
|
36
|
-
then echo "Using: \E[32m$GEM_HOME\E[0m" # show the user the ruby and gemset they are using in green
|
37
|
-
else echo "Using: $GEM_HOME" # don't use colors in non-interactive shells
|
38
|
-
fi
|
39
|
-
fi
|
40
|
-
else
|
41
|
-
# If the environment file has not yet been created, use the RVM CLI to select.
|
42
|
-
rvm --create "$environment_id" || {
|
43
|
-
echo "Failed to create RVM environment '${environment_id}'."
|
44
|
-
return 1
|
45
|
-
}
|
46
|
-
fi
|
47
|
-
|
48
|
-
# If you use bundler, this might be useful to you:
|
49
|
-
# if [[ -s Gemfile ]] && {
|
50
|
-
# ! builtin command -v bundle >/dev/null ||
|
51
|
-
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
|
52
|
-
# }
|
53
|
-
# then
|
54
|
-
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
55
|
-
# gem install bundler
|
56
|
-
# fi
|
57
|
-
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
58
|
-
# then
|
59
|
-
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
|
60
|
-
# fi
|