llama 0.2.0 → 0.3.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: 31bc627fb30fd35fe20d1a6edfc40cdcd2cb822a
4
- data.tar.gz: bef7cc48c344488d40468b65989f513c8b52ce84
3
+ metadata.gz: b8c6d2d7d277dcea14f7e263144c43cc1f7e736d
4
+ data.tar.gz: aec86efd0fc4c86cb804f54e79c3c09f57b90359
5
5
  SHA512:
6
- metadata.gz: 8e7b438c00092ea518aab43d769dd4a7c33d48f263e2c67654f25ec2ef9386a1ae8cd4a03a3403a594cfaccf9c35432a058b6196aa6de67fdb500c816306fa43
7
- data.tar.gz: '099f6a5233aab80e42e5a7a34afbd65149b264fb95a048294fedcc2adf85a18c290ddef32c4d1a4ef55fe1ffb6e8a99acda4f9927a42067c6d9e1ef937b12c4a'
6
+ metadata.gz: 3b83ba69ca3a6e98f1377c25e47424995aeed333e2775098a6764f2443209a33b43af6982a8d50a1f5ebf440462167ae7e76d050bee5d06ec8366a0a10cebc69
7
+ data.tar.gz: f665d74e7432fcefa167f5cba61e36802593ff5aaa329faa0d279a5d05583997863e61d54fa204bc895920a2b5b2941ea86f800c79f9924b012f1c0b0653ea96
@@ -1,9 +1,15 @@
1
1
  module Llama
2
2
  class Template
3
- attr_accessor :template_name
3
+ attr_accessor :template_name, :repo_path
4
4
 
5
- def initialize(template_name)
6
- @template_name = template_name
5
+ def initialize(template)
6
+ if template.include?('.git')
7
+ @template_name = template.match(/\/(.+)\.git$/)[1]
8
+ @repo_path = template
9
+ else
10
+ @template_name = template.split('/').last
11
+ @repo_path = "git@github.com:#{template_name}.git"
12
+ end
7
13
  end
8
14
 
9
15
  def render!(output_path, project_name)
@@ -19,13 +25,8 @@ module Llama
19
25
  `git clone #{repo_path} #{template_path} 2>&1 1>/dev/null`
20
26
  end
21
27
 
22
- def repo_path
23
- "git@github.com:#{template_name}.git"
24
- end
25
-
26
28
  def template_path
27
- File.expand_path("~/.llama/templates/#{template_name.split('/').last}")
29
+ File.expand_path("~/.llama/templates/#{template_name}")
28
30
  end
29
-
30
31
  end
31
32
  end
@@ -1,3 +1,3 @@
1
1
  module Llama
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: llama
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Ivannikov