letter_generator 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1703f9de1c7116601fe63a2b1c60968213d68e4c
4
- data.tar.gz: 953678207df481040b182144f4c000c94af33bcc
3
+ metadata.gz: c473dc17224fb6aaede89b093c35c91f83b220b1
4
+ data.tar.gz: bd846ebe3802e27ea4708b8477936ac63b806ecb
5
5
  SHA512:
6
- metadata.gz: 458d21184c35316d10db0cd28b3417459a6ba6e44bca112496ff98cda4ddc54f360ac02c35941916f8d7b52ee73ccc2c9458f4f5238ec50ccf81ed19cdb28ada
7
- data.tar.gz: f277dec130a37ceeea74a0502dad10d7276e10bda609e6e90e0d03fa865c2ee1c862262268e040bdf49205da371e6ac48d6e77eb6c66baa3abb51bfef5d8f051
6
+ metadata.gz: 4179d835309fcb34a5f015622d6378b30fb95268cc246b8f527794b7146d39f9b4e62752a2b4c264c9dcc40467073f07464cfcc5188acb367eaeb93c3172fa02
7
+ data.tar.gz: 29540c7b8939df77b5dbb0bade7f5a8324f51074cdfd97f8d1405e13d5acf96564190f15e2506fcfe53db93090cd14f5e78ebe136d841a17ed8689d373e83e2f
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  GIT
2
2
  remote: https://github.com/cucumber/aruba.git
3
- revision: ec87d91bb43011eb49b619d58c16a9fa22b5ac2f
3
+ revision: 5ae1ba967deaa904b275197d7f1236e783d72b65
4
4
  specs:
5
- aruba (0.6.1)
5
+ aruba (0.6.2)
6
6
  childprocess (>= 0.3.6)
7
7
  cucumber (>= 1.1.1)
8
8
  rspec-expectations (>= 2.7.0)
@@ -10,7 +10,7 @@ GIT
10
10
  PATH
11
11
  remote: .
12
12
  specs:
13
- letter_generator (0.0.3)
13
+ letter_generator (0.0.4)
14
14
  activesupport
15
15
  fedux_org-stdlib
16
16
  thor
@@ -29,7 +29,7 @@ GEM
29
29
  adamantium (0.2.0)
30
30
  ice_nine (~> 0.11.0)
31
31
  memoizable (~> 0.4.0)
32
- addressable (2.3.6)
32
+ addressable (2.3.7)
33
33
  anima (0.2.0)
34
34
  abstract_type (~> 0.0.7)
35
35
  adamantium (~> 0.1)
@@ -55,26 +55,26 @@ GEM
55
55
  concord (0.1.5)
56
56
  adamantium (~> 0.2.0)
57
57
  equalizer (~> 0.0.9)
58
- coveralls (0.7.1)
59
- multi_json (~> 1.3)
60
- rest-client
61
- simplecov (>= 0.7)
62
- term-ansicolor
63
- thor
64
- cucumber (1.3.18)
58
+ coveralls (0.7.9)
59
+ multi_json (~> 1.10)
60
+ rest-client (~> 1.7)
61
+ simplecov (~> 0.9.1)
62
+ term-ansicolor (~> 1.3)
63
+ thor (~> 0.19.1)
64
+ cucumber (1.3.19)
65
65
  builder (>= 2.1.2)
66
66
  diff-lcs (>= 1.1.3)
67
67
  gherkin (~> 2.12)
68
68
  multi_json (>= 1.7.5, < 2.0)
69
- multi_test (>= 0.1.1)
69
+ multi_test (>= 0.1.2)
70
70
  debugger-linecache (1.2.0)
71
71
  diff-lcs (1.2.5)
72
72
  docile (1.1.5)
73
73
  dotenv (1.0.2)
74
74
  equalizer (0.0.9)
75
75
  erubis (2.7.0)
76
- excon (0.43.0)
77
- fedux_org-stdlib (0.11.12)
76
+ excon (0.44.2)
77
+ fedux_org-stdlib (0.11.14)
78
78
  activesupport
79
79
  ffi (1.9.6)
80
80
  filegen (0.4.3)
@@ -125,9 +125,9 @@ GEM
125
125
  ice_nine (~> 0.11.0)
126
126
  procto (~> 0.0.2)
127
127
  multi_json (1.10.1)
128
- multi_test (0.1.1)
128
+ multi_test (0.1.2)
129
129
  multi_xml (0.5.5)
130
- mutant (0.7.4)
130
+ mutant (0.7.6)
131
131
  abstract_type (~> 0.0.7)
132
132
  adamantium (~> 0.2.0)
133
133
  anima (~> 0.2.0)
@@ -139,24 +139,24 @@ GEM
139
139
  memoizable (~> 0.4.2)
140
140
  morpher (~> 0.2.3)
141
141
  parallel (~> 1.3)
142
- parser (~> 2.2.pre.7)
142
+ parser (~> 2.2.0.2)
143
143
  procto (~> 0.0.2)
144
- unparser (~> 0.1.16)
145
- mutant-rspec (0.7.4)
146
- mutant (~> 0.7.4)
144
+ unparser (~> 0.2.2)
145
+ mutant-rspec (0.7.6)
146
+ mutant (~> 0.7.6)
147
147
  rspec-core (>= 3.0.0, < 3.2.0)
148
148
  netrc (0.10.2)
149
- parallel (1.3.3)
150
- parser (2.2.0.2)
149
+ parallel (1.3.4)
150
+ parser (2.2.0.3)
151
151
  ast (>= 1.1, < 3.0)
152
152
  posix-spawn (0.3.9)
153
- powerpack (0.0.9)
153
+ powerpack (0.1.0)
154
154
  procto (0.0.2)
155
155
  pry (0.10.1)
156
156
  coderay (~> 1.1.0)
157
157
  method_source (~> 0.8.1)
158
158
  slop (~> 3.4)
159
- pry-byebug (2.0.0)
159
+ pry-byebug (3.0.1)
160
160
  byebug (~> 3.4)
161
161
  pry (~> 0.10)
162
162
  pry-doc (0.6.0)
@@ -181,15 +181,15 @@ GEM
181
181
  rspec-mocks (3.1.3)
182
182
  rspec-support (~> 3.1.0)
183
183
  rspec-support (3.1.2)
184
- rubocop (0.28.0)
184
+ rubocop (0.29.1)
185
185
  astrolabe (~> 1.3)
186
- parser (>= 2.2.0.pre.7, < 3.0)
187
- powerpack (~> 0.0.6)
186
+ parser (>= 2.2.0.1, < 3.0)
187
+ powerpack (~> 0.1)
188
188
  rainbow (>= 1.99.1, < 3.0)
189
189
  ruby-progressbar (~> 1.4)
190
190
  ruby-progressbar (1.7.1)
191
- rugged (0.21.3)
192
- sequel (4.18.0)
191
+ rugged (0.21.4)
192
+ sequel (4.19.0)
193
193
  simplecov (0.9.1)
194
194
  docile (~> 1.1.0)
195
195
  multi_json (~> 1.0)
@@ -211,19 +211,20 @@ GEM
211
211
  thor (0.19.1)
212
212
  thread_safe (0.3.4)
213
213
  tilt (2.0.1)
214
- tins (1.3.3)
214
+ tins (1.3.4)
215
215
  tmrb (1.2.7)
216
216
  thor
217
217
  travis-lint (2.0.0)
218
218
  json
219
219
  tzinfo (1.2.2)
220
220
  thread_safe (~> 0.1)
221
- unparser (0.1.16)
221
+ unparser (0.2.2)
222
222
  abstract_type (~> 0.0.7)
223
223
  adamantium (~> 0.2.0)
224
224
  concord (~> 0.1.5)
225
+ diff-lcs (~> 1.2.5)
225
226
  equalizer (~> 0.0.9)
226
- parser (~> 2.2.0.pre.7)
227
+ parser (~> 2.2.0.2)
227
228
  procto (~> 0.0.2)
228
229
  versionomy (0.4.4)
229
230
  blockenspiel (>= 0.4.5)
@@ -3,7 +3,6 @@ Feature: Generate Letter
3
3
  Background:
4
4
  Given the default letter template
5
5
 
6
-
7
6
  Scenario: Non-existing letter
8
7
  Given a letter named "letter" does not exist
9
8
  When I successfully run `letter_generator generate`
@@ -0,0 +1,20 @@
1
+ Feature: Init generator
2
+
3
+ Background:
4
+ Given the default letter template
5
+
6
+ Scenario: Non-existing files
7
+ Given a data file named "data" does not exist
8
+ When I successfully run `letter_generator init`
9
+ Then a data file named "data" should contain:
10
+ """
11
+ from:
12
+ name:
13
+ street:
14
+ city:
15
+ to:
16
+ name:
17
+ street:
18
+ city:
19
+ subject:
20
+ """
@@ -19,3 +19,11 @@ end
19
19
  Given(/^a config file named "(.*?)" with:$/) do |name, string|
20
20
  step %(a file named "~/.config/letter_generator/#{name}" with:), string
21
21
  end
22
+
23
+ Given(/^a data file named "(.*?)" does not exist$/) do |name|
24
+ in_current_dir { FileUtils.rm_f File.expand_path("#{name}.yaml") }
25
+ end
26
+
27
+ Then(/^a data file named "(.*?)" should contain:$/) do |name, string|
28
+ step %(the file "#{name}.yaml" should contain:), string
29
+ end
@@ -2,6 +2,10 @@ module LetterGenerator
2
2
  class Runner < Thor
3
3
  include Thor::Actions
4
4
 
5
+ def self.exit_on_failure?
6
+ true
7
+ end
8
+
5
9
  option :output_file, default: 'letter.tex', desc: 'Outputfile'
6
10
 
7
11
  desc 'generate', 'Generate template'
@@ -12,5 +16,11 @@ module LetterGenerator
12
16
  generator = Generator.new(template.file)
13
17
  generator.run(content, options[:output_file])
14
18
  end
19
+
20
+ desc 'init', 'Init local directory'
21
+ def init
22
+ source_paths << File.expand_path('../../../templates', __FILE__)
23
+ template 'data', File.expand_path('data.yaml')
24
+ end
15
25
  end
16
26
  end
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # LetterGenerator
3
3
  module LetterGenerator
4
- VERSION = '0.0.4'
4
+ VERSION = '0.1.0'
5
5
  end
data/templates/data.tt ADDED
@@ -0,0 +1,9 @@
1
+ from:
2
+ name:
3
+ street:
4
+ city:
5
+ to:
6
+ name:
7
+ street:
8
+ city:
9
+ subject:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letter_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Max Meyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-14 00:00:00.000000000 Z
11
+ date: 2015-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -103,6 +103,7 @@ files:
103
103
  - bin/lg
104
104
  - cucumber.yml
105
105
  - features/generate_letter.feature
106
+ - features/init_generator.feature
106
107
  - features/step_definitions.rb
107
108
  - features/support/aruba.rb
108
109
  - features/support/env.rb
@@ -123,6 +124,7 @@ files:
123
124
  - spec/support/reporting.rb
124
125
  - spec/support/rspec.rb
125
126
  - spec/support/string.rb
127
+ - templates/data.tt
126
128
  - templates/letter.tex.tt
127
129
  homepage: https://github.com/maxmeyer/letter_generator
128
130
  licenses:
@@ -150,6 +152,7 @@ specification_version: 4
150
152
  summary: Generate letters
151
153
  test_files:
152
154
  - features/generate_letter.feature
155
+ - features/init_generator.feature
153
156
  - features/step_definitions.rb
154
157
  - features/support/aruba.rb
155
158
  - features/support/env.rb