gennaro 0.1.1 → 0.2
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 +4 -4
- data/lib/gennaro/file.rb +4 -4
- data/lib/gennaro/version.rb +1 -1
- data/spec/gennaro_spec.rb +28 -0
- metadata +33 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f276db9cbe8d7450b3fdbbb057a49d7ad9c56f5e
|
4
|
+
data.tar.gz: b4c8e77897d5600237aae200cea2a0b9049a7ff6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f6f92734e9f9a5c662aa6964c3c897d68a48c7211281c3094e38534860b586024461c04bbf824da0cb15179672a48f53d61048578948d07d148ce72f15f92c5
|
7
|
+
data.tar.gz: dc0c89c79ae0c4d2a9af2f78d0b5568d51f0ac36f2452e1bc7c9e766bc45585abda00cd8f010e1cd958fc960290b645720d76d33a67f554bd5981d66ff766aff
|
data/lib/gennaro/file.rb
CHANGED
@@ -9,6 +9,10 @@
|
|
9
9
|
#++
|
10
10
|
|
11
11
|
class Gennaro
|
12
|
+
def delete_dir(path)
|
13
|
+
FileUtils.rm_r path if Dir.exists? path
|
14
|
+
end
|
15
|
+
|
12
16
|
protected
|
13
17
|
def mkdir(path)
|
14
18
|
Dir.mkdir path unless Dir.exists? path
|
@@ -32,8 +36,4 @@ class Gennaro
|
|
32
36
|
new_file = file.gsub(first, after)
|
33
37
|
FileUtils.mv file, new_file if file != new_file
|
34
38
|
end
|
35
|
-
|
36
|
-
def delete_dir(path)
|
37
|
-
FileUtils.rm_r path if Dir.exists? path
|
38
|
-
end
|
39
39
|
end
|
data/lib/gennaro/version.rb
CHANGED
@@ -0,0 +1,28 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
require 'gennaro'
|
3
|
+
|
4
|
+
describe Gennaro do
|
5
|
+
it 'has built-in templates' do
|
6
|
+
template_path = File.expand_path '../../templates', __FILE__
|
7
|
+
Gennaro.get_templates(template_path).should_not be_empty
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'recognizes built-in templates' do
|
11
|
+
template_path = File.expand_path '../../templates', __FILE__
|
12
|
+
|
13
|
+
Gennaro.template_exists?(template_path, 'authentication' ).should be_true
|
14
|
+
Gennaro.template_exists?(template_path, 'sono ammeregano').should be_false
|
15
|
+
end
|
16
|
+
|
17
|
+
it 'generates templates correctly' do
|
18
|
+
template_path = File.expand_path '../../templates/authentication', __FILE__
|
19
|
+
gennaro = Gennaro.new template_path, 'Example', Dir.pwd, false
|
20
|
+
gennaro.generate!
|
21
|
+
gennaro.replace_tags!
|
22
|
+
|
23
|
+
Dir.exists?(File.join(Dir.pwd, 'example')).should be_true
|
24
|
+
File.exists?(File.join(Dir.pwd, 'example', 'example.rb')).should be_true
|
25
|
+
|
26
|
+
gennaro.delete_dir File.join(Dir.pwd, 'example')
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gennaro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
@@ -9,7 +9,35 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2013-12-15 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
description: Generate templates for Sinatra. The built-in template provide a user
|
14
42
|
authentication model, but you can add as many templates as you want.
|
15
43
|
email: webmaster@giovannicapuano.net
|
@@ -32,6 +60,7 @@ files:
|
|
32
60
|
- templates/authentication/spec/spec.rb
|
33
61
|
- templates/authentication/spec/user_spec.rb
|
34
62
|
- templates/authentication/_class_name_.rb
|
63
|
+
- spec/gennaro_spec.rb
|
35
64
|
- bin/gennaro
|
36
65
|
homepage: http://www.giovannicapuano.net
|
37
66
|
licenses:
|
@@ -57,4 +86,5 @@ rubygems_version: 2.0.3
|
|
57
86
|
signing_key:
|
58
87
|
specification_version: 4
|
59
88
|
summary: Sinatra template generator.
|
60
|
-
test_files:
|
89
|
+
test_files:
|
90
|
+
- spec/gennaro_spec.rb
|