makeme 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 906bfd7f169a73ba26c53d978aa797ccd2320dee
4
- data.tar.gz: 5d040d08aa8dee521feda04002f1b3a840a8dea7
3
+ metadata.gz: f8479e0344a32cad5430ce2bebce1834c4254568
4
+ data.tar.gz: aa6b64c6aba557c9cb8bcd150f9ec23bec982c23
5
5
  SHA512:
6
- metadata.gz: c73021461c3af0dc46858041edbb566c7d89e33791c3f5e2e54fd4908ac0ba3119fd66293f34cecfacca79277ecef8df2a6c62443008e46de569b3c861aba981
7
- data.tar.gz: 1ec0e67422f15a0ab6306c6b27e89cb3027e38c621aa047669946f323da01cd3cbf60a16cc541d1e3e8e187bc32b76d3f7e12daccc7af3444aab272dc061060f
6
+ metadata.gz: 1e976f7425702af1cf65a39d774fa8747f9eeda8d9d9e22e7cbc0a59653856fa42308f26da21db93e6f0bf42824a6d1284448780d5598423222abeac45285984
7
+ data.tar.gz: a6e02cb8c0388bbd431309062839e69ff2a147fb6038869511bdd31c357a5dc7b8cd8483eef93cafa0a6fd6edc1cefe78117fdab04d6a4c90da704f0163fdbba
data/README.md CHANGED
@@ -1,4 +1,5 @@
1
- # Makeme
1
+ # Makeme [![Build Status](https://travis-ci.org/beneills/makeme.svg?branch=master)](https://travis-ci.org/beneills/makeme) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)
2
+
2
3
  Create a new file by guessing contents from filename
3
4
 
4
5
  ## Usage
data/exe/makeme CHANGED
@@ -30,7 +30,7 @@ def main
30
30
 
31
31
  options = {}
32
32
 
33
- Makeme::run(working_directory, absolute_file_path, options)
33
+ Makeme.run(working_directory, absolute_file_path, options)
34
34
  end
35
35
 
36
36
  main
data/lib/makeme/fill.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'erb'
2
+
1
3
  require 'makeme/fill_helpers'
2
4
 
3
5
  module Fill
@@ -1,9 +1,3 @@
1
- module Internal
2
- def placeholder(text)
3
- text.upcase
4
- end
5
- end
6
-
7
1
  class FillHelpers
8
2
  def initialize(working_directory, absolute_file_path, guess_data)
9
3
  @working_directory = working_directory
@@ -15,6 +9,10 @@ class FillHelpers
15
9
  binding
16
10
  end
17
11
 
12
+ def placeholder(text)
13
+ text.upcase
14
+ end
15
+
18
16
  def parent_directory
19
17
  parent = Pathname.new(@absolute_file_path).parent.basename
20
18
 
@@ -33,6 +31,6 @@ class FillHelpers
33
31
  Etc.getlogin
34
32
  end
35
33
 
36
- def project; heuristic_project || Internal.placeholder("myproject"); end
37
- def username; heuristic_username || Internal.placeholder("username"); end
34
+ def project; heuristic_project || placeholder("myproject"); end
35
+ def username; heuristic_username || placeholder("username"); end
38
36
  end
@@ -1,3 +1,3 @@
1
1
  module Makeme
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
data/lib/makeme.rb CHANGED
@@ -13,11 +13,11 @@ module Makeme
13
13
  ! absolute_file_path.end_with?('/') || founder('File is a directory!')
14
14
 
15
15
  # Guess which template is right, or nil
16
- guess_data, template_contents = Guess::guess(working_directory, absolute_file_path, options)
16
+ guess_data, template_contents = Guess.guess(working_directory, absolute_file_path, options)
17
17
  ! template_contents.nil? || founder('Couldn\'t guess a template for that file!')
18
18
 
19
19
  # Fill in template
20
- contents = Fill::fill(working_directory, absolute_file_path, guess_data, template_contents, options)
20
+ contents = Fill.fill(working_directory, absolute_file_path, guess_data, template_contents, options)
21
21
 
22
22
  # Write to file
23
23
  open(absolute_file_path, 'w') do |f|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: makeme
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
  - Ben Eills