derb 0.1.0 → 0.2.0

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.
Files changed (6) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog.md +7 -1
  3. data/README.md +3 -2
  4. data/bin/derb +13 -10
  5. data/derb.gemspec +2 -4
  6. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08058237c3e205e79f41e7f1b84c44dd30c37717
4
- data.tar.gz: 8d6294d51898da277ef0fa95c17ffa0d16eb422b
3
+ metadata.gz: 318c62e63bcd9243e180c389ef24ebd0b5afbccb
4
+ data.tar.gz: a66829fd8824e0f2cc7eee4c277d5c7a20de056a
5
5
  SHA512:
6
- metadata.gz: 886ca979501fcbea53afc1369bd081eaf9b8cbada7cf9f7519ff1480ebd3d7dab873d587f7889dea051625ee2267d9b9e4e2976c2d55e960afea0c9b96bdca3b
7
- data.tar.gz: 42c3a82600b38c11e8223fb489f56f46a4ab51d65768a290a590736aa9d9509d0cbab9e277c4cbb7a46de36d687a1a1534560f1dc387262144e2702f36f249ee
6
+ metadata.gz: 0acb36629ffdc5eefe7d04d39a24058b82901aafcfc167b496c3d2ba32825051e19c8a3df4209c46f25c5563328501cbb00bbcc713b7f13ff657d5df9092bba4
7
+ data.tar.gz: dcb0ce47627b0974996ed0769320a0d8c8ae9abec6a7cebc663111a33050559aa67454790cee351925149a44efa848c9790aea14c80ec434a6606f1e90309994
@@ -1,4 +1,10 @@
1
- ### 0.1.0 / 2014-08-23
1
+ ### 0.2.0
2
+
3
+ * Allow to specify output file on command line as well
4
+ * Remove interactive mode
5
+
6
+
7
+ ### 0.1.0
2
8
 
3
9
  * Initial release
4
10
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # derb
1
+ # Dockerfile.erb
2
2
 
3
- Allows you to have Dockerfile.erb templates.
3
+ Allows you to have simple Dockerfile.erb templates.
4
4
 
5
5
 
6
6
  ## Install
@@ -14,6 +14,7 @@ In a directory with a `Dockerfile.erb` (and optionally a `Dockerfile.yml`), run:
14
14
 
15
15
  $ derb
16
16
 
17
+ It will create the Dockerfile for you.
17
18
 
18
19
  ## License
19
20
 
data/bin/derb CHANGED
@@ -5,7 +5,7 @@ require 'yaml'
5
5
  require 'ostruct'
6
6
 
7
7
  class Derb
8
- VERSION = '0.1.0'
8
+ VERSION = '0.1.1'
9
9
 
10
10
  def initialize(template_file = nil, data_file = nil)
11
11
  template_file = template_file || 'Dockerfile.erb'
@@ -27,20 +27,23 @@ class Derb
27
27
  )
28
28
  end
29
29
 
30
- def render_to_file(output_filename = 'Dockerfile')
30
+ def render_to_file(output_filename = nil)
31
+ output_filename = output_filename || 'Dockerfile'
32
+
31
33
  if File.exists? output_filename
32
- print "#{output_filename} already exists, overwrite? (y) "
33
- return if gets.chomp.upcase != "Y"
34
+ raise "#{output_filename} does already exist, aborting"
35
+ else
36
+ File.open(output_filename, 'w+'){ |f|
37
+ f.write(render)
38
+ }
39
+ puts "Created #{output_filename}"
34
40
  end
35
-
36
- File.open(output_filename, 'w+'){ |f|
37
- f.write(render)
38
- }
39
41
  end
40
42
  end
41
43
 
42
44
  begin
43
- Derb.new(ARGV[0], ARGV[1]).render_to_file
44
- rescue ArgumentError => e
45
+ Derb.new(ARGV[0], ARGV[1]).render_to_file(ARGV[2])
46
+ rescue => e
45
47
  $stderr.puts e.message
48
+ exit 1
46
49
  end
@@ -1,12 +1,10 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- load File.expand_path('../bin/derb', __FILE__)
4
-
5
3
  Gem::Specification.new do |gem|
6
4
  gem.name = "derb"
7
- gem.version = Derb::VERSION
5
+ gem.version = "0.2.0"
8
6
  gem.summary = 'Dockerfile.erb'
9
- gem.description = ' Allows you to have Dockerfile.erb templates.'
7
+ gem.description = 'Allows you to have Dockerfile.erb templates.'
10
8
  gem.license = "MIT"
11
9
  gem.authors = ["Jan Lelis"]
12
10
  gem.email = "mail@janlelis.de"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: derb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Lelis
@@ -10,7 +10,7 @@ bindir: bin
10
10
  cert_chain: []
11
11
  date: 2014-08-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: " Allows you to have Dockerfile.erb templates."
13
+ description: Allows you to have Dockerfile.erb templates.
14
14
  email: mail@janlelis.de
15
15
  executables:
16
16
  - derb