cook.ie 0.1.1 → 0.1.2

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: 1bc450a3d5e968f1aed942a4fb0a413f0f0c4b34
4
- data.tar.gz: da4ea4d608ebaba14bd08d6b48a2ae10103f9df1
3
+ metadata.gz: eee2f3661463449054da34d3e9f9e923756887f1
4
+ data.tar.gz: 48294e8d234071e6a9612dec7f086e055a1471f8
5
5
  SHA512:
6
- metadata.gz: fb7325ee69a15a49212ccb4aaa5bbbb3ca3ae12c0aa5baee6ec6930750391de63f88d93e01ba56cde2feb16f5f8fb70f4688920c2e70092f0d3aea336f4e1f15
7
- data.tar.gz: 6d852aaa579e4968c226ce2d0b291eba4e91d5fa1ff8e049d4668f7eeaa14a474beba10b4640a567c089e3e9ea192dee399d40c826947052c05a98ad574fd2bc
6
+ metadata.gz: af26ee0983faa3eaa60ab609651f1b44aeee3898ee0f2436878bb9d8f60f0afd18c96ffaec748138615cb870dc328abfdadaa2a3abf8f86202febda88cdf43a3
7
+ data.tar.gz: 4b632e8b6ef5259485e255ff6a5d81b4751961aa29d67ce3f48f074bf9493abed1d044985c6de5562e42a9bc19ed7d5d8b4dd74dc4c875109896ff8cc5765a0b
data/bin/cookie CHANGED
@@ -5,7 +5,6 @@ require "cookie_cutter"
5
5
 
6
6
  template_dir = ENV['CC_TEMPLATE_DIR']
7
7
  if template_dir.nil?
8
- puts "in here"
9
8
  template_dir = '~/Dropbox/!Templates'
10
9
  template_dir = File.expand_path(template_dir)
11
10
  end
@@ -1,4 +1,5 @@
1
1
  require 'pathname'
2
+ require 'erb'
2
3
 
3
4
  module CookieCutter
4
5
  # builds a text file with specified parameters
@@ -6,8 +7,8 @@ module CookieCutter
6
7
  # * it's name
7
8
  # * where to save itself
8
9
  class Cookie
9
- attr_accessor :name, :overwrite
10
- attr_accessor :template_options
10
+ attr_accessor :name, :output
11
+ attr_accessor :overwrite, :template_options
11
12
 
12
13
  # constants
13
14
  OUTPUT_DIR = 'output_dir'
@@ -18,17 +19,22 @@ module CookieCutter
18
19
  # defaults
19
20
  @overwrite = true
20
21
  @name = name
22
+ @output = {}
23
+ @output[:name] = name
21
24
  @template_options = template_options
22
25
  end
23
26
 
24
27
  def assemble
25
- ERB.new(File.open(self.template_path).read).result(binding)
28
+ _template_path = File.open(self.template_path).read
29
+ output = ERB.new(_template_path).result(binding)
30
+ return output
26
31
  end
27
32
 
28
33
  def save
34
+ template_output = self.assemble
29
35
  save_path = File.join(self.where_to_save, "#{@name}.txt")
30
36
  f = File.open(save_path, 'w+')
31
- f.write(self.assemble)
37
+ f.write(template_output)
32
38
  end
33
39
 
34
40
  # assumption, all templates will be kept in the config directory
@@ -1,3 +1,3 @@
1
1
  module CookieCutter
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cook.ie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ritchie Macapinlac
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-02-10 00:00:00.000000000 Z
11
+ date: 2016-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: log4r